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

Problems with git am

From
AAlan <alan@clueserver.org>
Date
Oct 27, 2009, 00:12 UTC
Message-ID
<59976.134.134.139.70.1256602329.squirrel@clueserver.org>

I am encountering an interesting issue. I am not certain if I am doing something wrong or I am encountering a bug or what.

I am using Git version 1.6.0.6 from Fedora 9. I am not using the current version because it has changed how it errors out. (If git does not understand the patch, instead of exiting with an error code that xargs will fail on it exits with something non-fatal.)

I have a number of patches that I have been handed to apply to a git tree.

The patches have been generated by git, but have not been e-mailed. (They may have been extracted from gitweb or some other source.)

The header of the patch looks like:
commit 62b266585bb5555d44a764c90d80f9c4bb8188c1
Author: Joe Example <joe@example.com>
Date:   Wed Sep 19 10:03:47 2009 -0600
There is no e-mail line, but it has the information for e-mail address.
If I apply this patch it will error out with:
"Patch does not have a valid e-mail address."

If I use a current version of Git it errors out with a message "Cannot determine patch format", but does not issue a fatal error code.

If I use git-apply on this patch, it applies it to the tree, but does not commit it. (I need the comments and signoffs to remain intact.) I have to cut-and-paste the commit information to keep it. (I am working on an automated process to handle these patches and don' want to have to reinvent git-am.)

Am i doing something wrong here?

My goal is to be able to take whatever patch I am handed and apply it to the current tree. If it is a raw diff, I can handle that. What concerns me are these patches that look like they are generated by git, but which do not apply cleanly with git-am.

Is there some sort of instructions for applying patches that are dumped out using "git-show" or some other mechanism?

I am not finding this process documented anywhere. (If it is, it is pretty well hidden.)

Thanks!
Next: Junio C Hamano
Message 1 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.