git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] am -3: list the paths that needed 3-way fallback
@ 2012-03-29  4:04 Junio C Hamano
  0 siblings, 0 replies; only message in thread
From: Junio C Hamano @ 2012-03-29  4:04 UTC (permalink / raw)
  To: git

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>
---

 git-am.sh |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/git-am.sh b/git-am.sh
index 4da0dda..e686a17 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -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
-- 
1.7.10.rc2.76.gd2b7f

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-29  4:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-29  4:04 [PATCH] am -3: list the paths that needed 3-way fallback Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).