Skip to content

Commit 8d229f8

Browse files
author
MarcoFalke
committed
github-merge: Add option to overwrite user email
1 parent 05df58e commit 8d229f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

github-merge.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ def parse_arguments():
252252
githubmerge.pushmirrors (default: none, comma-separated list of mirrors to push merges of the master development branch to, e.g. `[email protected]:<owner>/<repo>.git,[email protected]:<owner>/<repo>.git`),
253253
user.signingkey (mandatory),
254254
user.ghtoken (default: none).
255+
githubmerge.merge-author-email (default: Email from git config),
255256
githubmerge.host (default: [email protected]),
256257
githubmerge.branch (no default),
257258
githubmerge.testcmd (default: none).
@@ -271,6 +272,7 @@ def main():
271272
repo = git_config_get('githubmerge.repository')
272273
host = git_config_get('githubmerge.host','[email protected]')
273274
opt_branch = git_config_get('githubmerge.branch',None)
275+
merge_author_email = git_config_get('githubmerge.merge-author-email',None)
274276
testcmd = git_config_get('githubmerge.testcmd')
275277
ghtoken = git_config_get('user.ghtoken')
276278
signingkey = git_config_get('user.signingkey')
@@ -445,6 +447,8 @@ def main():
445447
if reply == 's':
446448
try:
447449
config = ['-c', 'user.name=merge-script']
450+
if merge_author_email:
451+
config += ['-c', f'user.email={merge_author_email}']
448452
subprocess.check_call([GIT] + config + ['commit','-q','--gpg-sign','--amend','--no-edit','--reset-author'])
449453
break
450454
except subprocess.CalledProcessError:

0 commit comments

Comments
 (0)