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

Re: Log messages beginning # and git rebase -i

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 28, 2015, 16:30 UTC
Message-ID
<xmqqr3nsfdmw.fsf@gitster.dls.corp.google.com>
In-Reply-To
<vpqsi88qp6q.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 23 quoted lines
> Ed Avis <eda@waniasset.com> writes:
>
>> Eric Sunshine <sunshine <at> sunshineco.com> writes:
>>
>>>>the editing for the
>>>>combined log message treats lines beginning with # as comments.  This means
>>>>that if you are not careful the commit message can get lost on rebasing.
>>>>
>>>>I suggest that git rebase should add an extra space at the start
>>
>>>'git rebase --interactive' respects the core.commentChar configuration
>>>variable, which you can set to some value other than '#'.
>>
>> I was thinking of the default configuration.  But you are right, this applies
>> to whatever the comment character is - so if commentChar is set to * for
>> example, then log lines beginning with * should get an extra space prepended
>> in git rebase --interactive so that they don't get lost.
>
> Actually, is there any reason why we do not allow a simple escaping like
>
> \# this is a line starting with #
> \\ this is a line starting with \
> # this is a comment
What are we trying to achieve?

Munging the original "# I want this line intact" to any other form like " # I want this..." is as bad as losing it. If the user wants whatever she types in the resulting commit literally, there is the "--cleanup=<choice>" option, no?

Previous: Matthieu MoyNext: Ed Avis
Message 6 of 18 in “Log messages beginning # and git rebase -i”
  1. Ed AvisJul 27, 2015
  2. Eric SunshineJul 27, 2015
  3. Duy NguyenJul 28, 2015
  4. Ed AvisJul 28, 2015
  5. Matthieu MoyJul 28, 2015
  6. Junio C HamanoJul 28, 2015
  7. Ed AvisJul 28, 2015
  8. Matthieu MoyJul 28, 2015
  9. Junio C HamanoJul 28, 2015
  10. Matthieu MoyJul 29, 2015
  11. Ed AvisJul 29, 2015
  12. allow commentChars in commit messagesCorentin BOMPARD, Apr 22, 2019
  13. Duy NguyenJul 29, 2015
  14. Matthieu MoyJul 29, 2015
  15. Duy NguyenJul 29, 2015
  16. Junio C HamanoJul 29, 2015
  17. Matthieu MoyJul 29, 2015
  18. Junio C HamanoJul 29, 2015

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.