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

Re: GSoC idea: allow "git rebase --interactive" todo lines to take options

From
Jeff King <peff@peff.net>
Date
Feb 26, 2014, 11:42 UTC
Message-ID
<20140226114200.GA3779@sigill.intra.peff.net>
In-Reply-To
<530DCC83.1060805@alum.mit.edu>
On Wed, Feb 26, 2014 at 12:14:11PM +0100, Michael Haggerty wrote:
Show 9 quoted lines
> > [1] The one feature I would like in this vein is that editing the title
> >     in the instruction-sheet would modify the commit message of the
> >     relevant commit. For some reason I try to do this every few weeks,
> >     but of course the changes are just thrown away.
> 
> Given that commit messages can be more than one line long, a feature
> like this would be confusing, I think, and perhaps subtly encourage
> people to limit their commit messages to a single line, which would be a
> bad thing.

Right, I was assuming it would just modify the subject-line, and leave the rest intact (I often want to use it to just replace one word or fix a typo, since I am starting right at it in the insn sheet).

> Plus, until now such edits were thrown away, so there are
> backwards compatibility problems if we suddenly start preserving such edits.

Good point. For true interactive use it probably wouldn't be that big a deal, but people do weird things with GIT_EDITOR and auto-munging the list of commits. A heuristic like "is there any message there at all" might work, as you mentioned, but heuristics make me nervous.

> But using the other ideas discussed here one could do
> 
>     pick -m "New log message" <sha1>

Yeah, that would work, though you have to retype the whole thing, which is potentially annoying (clever use of your editor can pull it over from the other side, but it's not super-friendly).

Something like:
  pick --subject <sha1> <modified message...>
would be simpler.
>     amend -m "Revised log message"

That would replace the whole message, which I definitely don't want (and would encourage bad habits).

Show 6 quoted lines
> Another, more wonkish idea I though of would be
> 
>     pick --tree=<treeish> <sha1>
> 
> to force the tree of the commit to be set to that of the specified
> <treeish> while keeping the commit metadata from <sha1>.

I think there's a large foot-shooting capacity there. Any commit you've reordered from after the "--tree" to before it will mysteriously get undone in the "--tree" commit. E.g.:

  pick aaaaaaa
  pick bbbbbbb
  pick ccccccc
being done as:
  pick ccccccc
  pick bbbbbbb
  pick --tree=bbbbbbb aaaaaaa
-Peff
Previous: Michael HaggertyNext: Tay Ray Chuan
Message 4 of 12 in “GSoC idea: allow "git rebase --interactive" todo lines to take options”
  1. Michael HaggertyFeb 26, 2014
  2. Jeff KingFeb 26, 2014
  3. Michael HaggertyFeb 26, 2014
  4. Jeff KingFeb 26, 2014
  5. Tay Ray ChuanFeb 26, 2014
  6. Junio C HamanoFeb 26, 2014
  7. Michael HaggertyFeb 27, 2014
  8. Brandon McCaigFeb 27, 2014
  9. Jeff KingFeb 28, 2014
  10. Michael HaggertyFeb 28, 2014
  11. Jeff KingMar 11, 2014
  12. Junio C HamanoMar 11, 2014

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.