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

2.6.0: Comment in rebase instruction has become too rigid

From
Nazri Ramliy <ayiehere@gmail.com>
Date
Sep 29, 2015, 14:02 UTC
Message-ID
<CAEY4ZpN0C96jU4Tgvqt-hWEviR-sapDoyAv88H+opPSr-cs=mg@mail.gmail.com>
Hi,

I noticed that the format of the comment lines in a rebase instruction sheet has become stricter - it could no longer begin with spaces or tabs. The comment char ("#" for example) has to appear on the first column.

This break my little script (activated via some key binding in my $EDITOR) for adding the list of modified files under each "pick" command. The way I have it setup is something like this, given the following rebase intruction:

  pick deadbeef some commit message
  pick cafebabe another commit message

I'd hit that key in my editor that filters the pick instructions add inserts the list of the modified files in each commit so that the instruction sheet becomes like this:

  pick deadbeef some commit message
     # M path/to/foo.txt | 15 ++++----------
  pick cafebabe another commit message
     # M bar.txt | 2 +-

IIRC before git 2.6.0 this worked fine. With git 2.6.0 the rebase stops midway with warning about invalid instruction due to the now no-longer recognized indented comments.

I could work around this by changing my script so that it removes the indentation prefix so that the instruction would become like this:

  pick deadbeef some commit message
  # M path/to/foo.txt | 15 ++++----------
  pick cafebabe another commit message
  # M bar.txt | 2 +-

but this would make it harder to read because of the increased clutter between the rebase instructions and the informative "what files were changed in this commit" comment.

Looking at git-rebase--interactive.sh it seems that this is due to "git stripspace --strip-comments".

Would it be okay if the behavior is reverted to the old one - which is to recognize indented comments in the rebase instruction?

Nazri
Next: Matthieu Moy
Message 1 of 6 in “2.6.0: Comment in rebase instruction has become too rigid”
  1. Nazri RamliySep 29, 2015
  2. Matthieu MoySep 29, 2015
  3. Matthieu MoySep 29, 2015
  4. Junio C HamanoSep 29, 2015
  5. Junio C HamanoSep 29, 2015
  6. Ralf ThielowSep 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.