Skip to content

Commit

Permalink
am -3: list the paths that needed 3-way fallback
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Mar 28, 2012
1 parent 6c15a1c commit 5d86861
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ fall_back_3way () {
say Using index info to reconstruct a base tree...

cmd='GIT_INDEX_FILE="$dotest/patch-merge-tmp-index"'

if test -z "$GIT_QUIET"
then
eval "$cmd git diff-index --cached --diff-filter=AM --name-status HEAD"
fi

cmd="$cmd git apply --cached $git_apply_opt"' <"$dotest/patch"'
if eval "$cmd"
then
Expand Down

0 comments on commit 5d86861

Please sign in to comment.