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

Re: Problems with git am

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 27, 2009, 00:52 UTC
Message-ID
<7vvdi1bqv8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<59976.134.134.139.70.1256602329.squirrel@clueserver.org>
"Alan" <alan@clueserver.org> writes:
Show 5 quoted lines
> The header of the patch looks like:
>
> commit 62b266585bb5555d44a764c90d80f9c4bb8188c1
> Author: Joe Example <joe@example.com>
> Date:   Wed Sep 19 10:03:47 2009 -0600
It shouldn't.

The format "git am" understands is a mbox file and format-patch is the command to write commits out in that form. It should begin with lines that look like:

    From 610f99ec7d22b5750f12350f67c1341d6be8030f Mon Sep 17 00:00:00 2001
    From: Junio C Hamano <gitster@pobox.com>
    Date: Sun, 25 Oct 2009 18:41:09 -0700
    Subject: [PATCH] Update draft release notes to 1.6.6
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    ---
    .... patch follows here ...

I do not think it is particularly hard to add a new case arm in "am" to support "git log" output. It is different from a mbox format in that it

 * begins each commit with "commit " marker;
 * has Author: and Date: header that is different from a mailbox;
 * lacks Subject: but makes it part of the message body; and
 * indents the message by 4 places.
Nobody has bothered to do so, probably because nobody needed it.

The easiest, safest and quickest for you right now (meaning, before waiting for anybody to help you by adding a new feature to "am") would be to see if it is possible for you to get the commits re-exported in an appropriate format.

I say the "safest" in the above because you _could_ massage what you have into a format that looks like a mbox with some Perl script, but it risks mismassaging.

Previous: AlanNext: alan
Message 2 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.