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

Re: Log messages beginning # and git rebase -i

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 29, 2015, 12:17 UTC
Message-ID
<vpq8u9zjgzl.fsf@anie.imag.fr>
In-Reply-To
<CACsJy8ABsHBA1TubB+6fypT0LGQF_O+CmHPqL+C7nMVjjWy38w@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 14 quoted lines
> On Wed, Jul 29, 2015 at 12:48 AM, Matthieu Moy
> <Matthieu.Moy@grenoble-inp.fr> wrote:
>>> If the user wants whatever she types in the resulting commit
>>> literally, there is the "--cleanup=<choice>" option, no?
>>
>> $ GIT_EDITOR=touch git commit --cleanup=verbatim
>> [detached HEAD 1b136a7] # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want
>> to. # An empty message aborts the commit. # HEAD detached from 5e70007 # Changes to be committed: #     modified:   foo.txt # # Changes not staged for commit
>> : #     modified:   foo.txt # # Untracked files: #      last-synchro.txt #
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> You really don't want that in day-to-day use.
>
> How about --cleanup=scissors?
I can read this in two different ways:
1) Keeping git as-is and suggest users to use --cleanup=scissors
   This has the same problem as --cleanup=verbatim: it doesn't work as-is
   since Git doesn't insert the scissors. You can hack around it by
   adding them by yourself when you need it, but it's really not
   convenient. You have to anticipate that you're going to require a #
   and call commit with --cleanup=scissors, add the scissors. And repeat
   it if you need to "commit --amend".
2) Modify Git to add scissors by default, and use --cleanup=scissors by
   default.
 
   This is actually more or less what SVN does: it inserts a line
   "--This line, and those below, will be ignored--", and the equivalent
   of what Git adds as comments in the template is inserted below this
   line.

I don't think option 1) is good. The fact that we have the --cleanup= option shouldn't serve as an excuse to do nothing. I'd be fine with option 2), but I find it much more intrusive than to allow a simple backslash-escaping as I suggest.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Duy NguyenNext: Duy Nguyen
Message 14 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.