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

Re: [PATCH v3] Teach merge the '[-e|--edit]' option

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 11, 2011, 00:00 UTC
Message-ID
<7v1uukieh2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAG+J_Dz37etot0nNkq+1gTUy8R0vVJpsRQuvwrTSczXRWy7mkA@mail.gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
Show 5 quoted lines
>> I am not sure about the '\n' you unconditionally added at the end of the
>> existing message.
>
> Right, the old code does that when the merge fails, counting on (I
> think) git-commit to then take care of any extra newlines.

Ahh, that explains it. I was originally about to suggest running the stripspace() only when we run the editor, and saw a failure from an unrelated test and realized that running stripspace() on the result of prepare-commit-msg is the right thing to do after all, because that is what is done by "git commit". Yes, the current code does rely on the stripspace to remove it, so there is no need to make it conditional.

So if we drop the "conditionally add '\n'" part in builtin/merge.c from my "how about this on top" patch and we should be ready to go, right?

Thanks.
Previous: Jay SoffianNext: Jay Soffian
Message 4 of 6 in “Teach merge the '[-e|--edit]' option”
  1. Teach merge the '[-e|--edit]' optionJay Soffian, Oct 8, 2011
  2. Junio C HamanoOct 10, 2011
  3. Jay SoffianOct 10, 2011
  4. Junio C HamanoOct 11, 2011
  5. Jay SoffianOct 11, 2011
  6. Peter KreftingOct 11, 2011

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.