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, 10:52 UTC
Message-ID
<20140226105249.GE25711@sigill.intra.peff.net>
In-Reply-To
<530DA00E.4090402@alum.mit.edu>
On Wed, Feb 26, 2014 at 09:04:30AM +0100, Michael Haggerty wrote:
Show 6 quoted lines
> It would be nice to support more flexibility in the todo-list commands
> by allowing the commands to take options.  Maybe
> 
> * Convert a commit into a merge commit:
> 
>       pick -p c0ffeee -p e1ee712 deadbab The oneline of the commit after

This seems like a reasonable feature to me. All of your examples are possible with an "e"dit and another git command, but the convenience may be worth it (though personally, most of the examples you gave are particularly interesting to me[1]).

I'd worry a little that it is not a summer's worth of work, but I suspect there are other parts of rebase--interactive that could use attention once the student is familiar with the code.

Show 16 quoted lines
> * After squashing two commits, add a "Signed-off-by" line to the
>   commit log message:
> 
>     pick deadbee Implement feature XXX
>     squash --signoff f1a5c00 Fix to feature XXX
> 
>   or GPG-sign a commit:
> 
>     pick --gpg-sign=<keyid> deadbee Implement feature XXX
> 
> * Reset the author of the commit to the current user or a specified
>   user:
> 
>     pick --reset-author deadbee Implement feature XXX
>     pick --author="A U Thor <author@example.com>" deadbab The oneline of
> the commit after

Your first example would need some commit-tree magic, I think. But could you implement these two with:

   pick deadbee Implement feature XXX
   exec git commit --amend --signoff --reset-author

? You could even alias the "amend" command to "exec git commit --amend", like:

  amend --signoff --reset-author
Maybe that is unnecessarily unfriendly to the user, though.
-Peff
[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.
Previous: Michael HaggertyNext: Michael Haggerty
Message 2 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.