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

Re: Re* [GIT PULL] sh updates for 2.6.25

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 16, 2008, 20:22 UTC
Message-ID
<200804162222.18827.jnareb@gmail.com>
In-Reply-To
<7v3aplr2pt.fsf_-_@gitster.siamese.dyndns.org>

Junio C Hamano wrote: [cut]

Show 26 quoted lines
> So in short, when you use "am", it by design unfolds the "Subject: " line
> and there is no bug there.  "rebase" being implemented in terms of
> "format-patch piped to am" does mangle the message because of this, but
> if anything that is a bug in rebase, and not "am".
> 
> And this is a potential fix to the issue, which was made possible only
> because recently "rebase" started passing an extra option to "am".
> 
> -- >8 --
> From: Junio C Hamano <gitster@pobox.com>
> Date: Wed, 16 Apr 2008 12:50:48 -0700
> Subject: [PATCH] rebase: do not munge commit log message
> 
> Traditionally git-rebase was implemented in terms of "format-patch" piped
> to "am -3", to strike balance between speed (because it avoids a rather
> expensive read-tree/merge-recursive machinery most of the time) and
> flexibility (the magic "-3" allows it to fall back to 3-way merge as
> necessary).  However, this combination has one flaw when dealing with a
> nonstandard commit log message format that has more than one lines in the
> first paragraph, because such a "first line" is formatted as logically a
> single line, and unfolded at the applying end.
> 
> This teaches "git am --rebasing" to take advantage of the fact that the
> mbox message "git rebase" prepares for it records the original commit
> object name, and that such a commit _is_ available locally.  It reads the
> log message from the original commit object instead.

IIRC there was alternate patch which made git-format-patch to add extra email header meant for git-am to "obey the (encoded) commit message formatting."

But this solution is simpler, and I think better.
-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Miklos Vajna
Message 15 of 17 in “Re: [GIT PULL] sh updates for 2.6.25”
  1. Linus TorvaldsApr 15, 2008
  2. Linus TorvaldsApr 15, 2008
  3. Paul MundtApr 15, 2008
  4. Linus TorvaldsApr 15, 2008
  5. Alex RiesenApr 16, 2008
  6. Junio C HamanoApr 16, 2008
  7. Linus TorvaldsApr 16, 2008
  8. Junio C HamanoApr 15, 2008
  9. Jakub NarebskiApr 15, 2008
  10. Miklos VajnaApr 16, 2008
  11. format-patch: Make sure the subject is always a one-linerMiklos Vajna, Apr 16, 2008
  12. Junio C HamanoApr 16, 2008
  13. Miklos VajnaApr 16, 2008
  14. Re* [GIT PULL] sh updates for 2.6.25Junio C Hamano, Apr 16, 2008
  15. Jakub NarebskiApr 16, 2008
  16. Miklos VajnaApr 17, 2008
  17. David WoodhouseApr 27, 2008

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.