Skip to content

Commit bc085e0

Browse files
committed
please.sh rebase: record conflict resolutions also for merge commits
When we use the Git garden shears, we often redo merges. Merge conflicts are quite common for that operation, so we should use rerere for those, too. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7fa1bf4 commit bc085e0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

please.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,12 @@ record_rerere_train () {
576576
cp "$orig_index" "$GIT_INDEX_FILE" &&
577577
git add -u &&
578578
tree4="$(git write-tree)" &&
579-
stopped_sha="$(git rev-parse --git-path rebase-merge/stopped-sha)" &&
580-
stopped_sha="$(cat "$stopped_sha")" &&
579+
if ! stopped_sha="$(git rev-parse --git-path \
580+
rebase-merge/stopped-sha)" ||
581+
! stopped_sha="$(cat "$stopped_sha")"
582+
then
583+
stopped_sha="$(git rev-parse -q --verify MERGE_HEAD)"
584+
fi &&
581585
base_msg="$(printf "cherry-pick %s onto %s\n\n%s\n%s\n\n\t%s" \
582586
"$(git show -s --pretty=tformat:%h $stopped_sha)" \
583587
"$(git show -s --pretty=tformat:%h HEAD)" \

0 commit comments

Comments
 (0)