git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] am -3: list the paths that needed 3-way fallback

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 29, 2012, 04:04 UTC
Message-ID
<7v1uocrr2b.fsf@alter.siamese.dyndns.org>

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
Message 1 of 1 in “am -3: list the paths that needed 3-way fallback”
  1. am -3: list the paths that needed 3-way fallbackJunio C Hamano, Mar 29, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.