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

[PATCHv4 2/5] am: suppress apply errors when using 3-way

From
Stephen Boyd <bebarino@gmail.com>
Date
Jun 16, 2009, 22:32 UTC
Message-ID
<1245191581-11127-3-git-send-email-bebarino@gmail.com>
In-Reply-To
<1245191581-11127-2-git-send-email-bebarino@gmail.com>

git-am with 3-way outputs errors when applying, even though the 3-way will usually be successful. We suppress these errors from git-apply because they are not "true" errors until the 3-way has been attempted.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---

Seems to me like we should always suppress these errors if we're falling back to 3-way. So I've removed the test for GIT_QUIET and pushed this earlier in the series.

 git-am.sh |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index 578780b..e26c54a 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -502,7 +502,14 @@ do
 
 	case "$resolved" in
 	'')
-		eval 'git apply '"$git_apply_opt"' --index "$dotest/patch"'
+		# When we are allowed to fall back to 3-way later, don't give
+		# false errors during the initial attempt.
+		squelch=
+		if test "$threeway" = t
+		then
+			squelch='>/dev/null 2>&1 '
+		fi
+		eval "git apply $squelch$git_apply_opt"' --index "$dotest/patch"'
 		apply_status=$?
 		;;
 	t)
-- 
1.6.3.2.306.g4f4fa
Previous: Stephen BoydNext: Stephen Boyd
Message 14 of 18 in “[PATCHv3 0/4] Teach shell scripts to be quiet”
  1. Stephen BoydJun 16, 2009
  2. 1/4 t4150: test applying with a newline in subjectStephen Boyd, Jun 16, 2009
  3. 2/4 git-sh-setup: introduce say() for quiet optionsStephen Boyd, Jun 16, 2009
  4. 3/4 submodule, repack: migrate to git-sh-setup's say()Stephen Boyd, Jun 16, 2009
  5. 4/4 am, rebase: teach quiet optionStephen Boyd, Jun 16, 2009
  6. Junio C HamanoJun 16, 2009
  7. Stephen BoydJun 16, 2009
  8. Junio C HamanoJun 16, 2009
  9. Junio C HamanoJun 16, 2009
  10. Stephen BoydJun 16, 2009
  11. Johannes SixtJun 16, 2009
  12. 0/5 Teach shell scripts to be quietStephen Boyd, Jun 16, 2009
  13. 1/5 t4150: test applying with a newline in subjectStephen Boyd, Jun 16, 2009
  14. 2/5 am: suppress apply errors when using 3-wayStephen Boyd, Jun 16, 2009
  15. 3/5 git-sh-setup: introduce say() for quiet optionsStephen Boyd, Jun 16, 2009
  16. 4/5 submodule, repack: migrate to git-sh-setup's say()Stephen Boyd, Jun 16, 2009
  17. 5/5 am, rebase: teach quiet optionStephen Boyd, Jun 16, 2009
  18. 6/5 stash: teach quiet optionStephen Boyd, Jun 18, 2009

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.