Skip to content

Commit 691bd79

Browse files
committed
Change squash commit message
Use PR title and body instead of concatenation of all squased commits
1 parent 7a6c080 commit 691bd79

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

homu/main.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,10 @@ def create_merge(state, repo_cfg, branch, logger, git_cfg,
921921
state.title,
922922
state.body)
923923

924+
squash_msg = '{}\n\n{}'.format(
925+
state.title,
926+
state.body)
927+
924928
desc = 'Merge conflict'
925929
comment = (
926930
'This pull request and the master branch diverged in a way that cannot'
@@ -1028,18 +1032,18 @@ def create_merge(state, repo_cfg, branch, logger, git_cfg,
10281032
'merge-base',
10291033
base_sha,
10301034
state.head_sha)).decode('ascii').strip()
1031-
git_editor = os.environ['GIT_EDITOR']
1032-
os.environ['GIT_EDITOR'] = "sed -i '2,/^$/s/^pick\b/s/'"
1035+
utils.logged_call(git_cmd(
1036+
'reset',
1037+
'--soft',
1038+
merge_base_sha))
10331039
utils.logged_call(git_cmd(
10341040
'-c',
10351041
'user.name=' + git_cfg['name'],
10361042
'-c',
10371043
'user.email=' + git_cfg['email'],
1038-
'rebase',
1039-
'-i',
1040-
'--onto',
1041-
merge_base_sha, base_sha))
1042-
os.environ['GIT_EDITOR'] = git_editor
1044+
'commit',
1045+
'-m',
1046+
squash_msg))
10431047
except subprocess.CalledProcessError:
10441048
desc = 'Squashing failed'
10451049
comment = ''

0 commit comments

Comments
 (0)