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

Re: Problems with git am

From
Jeff King <peff@peff.net>
Date
Oct 27, 2009, 19:02 UTC
Message-ID
<20091027190234.GA19454@sigill.intra.peff.net>
In-Reply-To
<7veiopbm9l.fsf@alter.siamese.dyndns.org>
On Mon, Oct 26, 2009 at 07:31:34PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> alan <alan@clueserver.org> writes:
> 
> > The other question is what the proper behaviour when git-am in unable
> > to process a patch.  Under git 1.6.0, it exits with a non-zero error
> > code. Under the current git in the git repo it issues and error and
> > exits with a non-error exit code.
> 
> Hmph, that sounds like a recent regression to me.  I'll try to find time
> to look into it myself sometime tonight but no promises.

I'm having trouble reproducing, either with a totally bogus input format or with "git log -p" output (which is what it sounds like the OP has). Both of these tests already pass on 'next':

diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 8296605..2d5e32a 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -346,4 +346,17 @@ test_expect_success 'am -q is quiet' '
 	! test -s output.out
 '
 
+test_expect_success 'am properly reports error' '
+	echo excellent > bogus &&
+	test_must_fail git am bogus
+'
+
+test_expect_success 'am properly reports error (git log output)' '
+	echo more content >>file &&
+	git commit -m content file &&
+	git log -1 -p > bogus &&
+	git reset --hard HEAD^ &&
+	test_must_fail git am bogus
+'
+
 test_done
Previous: Junio C Hamano
Message 5 of 5 in “Problems with git am”
  1. AlanOct 27, 2009
  2. Junio C HamanoOct 27, 2009
  3. alanOct 27, 2009
  4. Junio C HamanoOct 27, 2009
  5. Jeff KingOct 27, 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.