Skip to content

Commit 5d86861

Browse files
committed
am -3: list the paths that needed 3-way fallback
When applying a patch that was based on an older release with "am -3", I often wonder changes to which files need to be reviewed with extra care to spot mismerges, but there is no good indication. The paths that needed 3-way fallback can easily be obtained by comparing the synthesized (partial) base tree and the current HEAD and noticing only additions and modifications (removals only show the sparseness of the fake ancestor tree, which is not useful information at all). List them in the usual --name-status format. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6c15a1c commit 5d86861

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

git-am.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ fall_back_3way () {
138138
say Using index info to reconstruct a base tree...
139139

140140
cmd='GIT_INDEX_FILE="$dotest/patch-merge-tmp-index"'
141+
142+
if test -z "$GIT_QUIET"
143+
then
144+
eval "$cmd git diff-index --cached --diff-filter=AM --name-status HEAD"
145+
fi
146+
141147
cmd="$cmd git apply --cached $git_apply_opt"' <"$dotest/patch"'
142148
if eval "$cmd"
143149
then

0 commit comments

Comments
 (0)