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

Feature idea: git rebase --exec $CMD

From
Antonio Ospite <ospite@studenti.unina.it>
Date
May 5, 2012, 11:26 UTC
Message-ID
<20120505132650.637c4e06086654e0dbf641fc@studenti.unina.it>
Hi,

I find the x/exec function in "git rebase -i" very useful, but it may be tedious to edit the commit list to add something like "make test" after each commit.

Can this functionality be exposed from the command line as well? I am thinking to a [-x|--exec <command>] options which accepts a command as an argument, and executes such command after each commit in the list of commits which are going to be rebased, and stops the rebasing if the command returns a non-0 value.

Maybe this -x option should conflict with -i to simplify its "execute the command after each commit" semantics (what if it is combined with -i and 'x/exec' lines?).

I can draft the man page section for it, but I doubt I can work on the code for now, so I wanted to throw the idea here and see if anyone else wants to pick it up.

I read that calling a "make test" command after each commit could be done using "git rev-list" like in http://sethrobertson.github.com/GitPostProduction/gpp.html#post-post-production but a more friendly way to do that from CLI would be great.

Thanks,
   Antonio
P.S. I am not subscribed to the list, please CC me.
-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
Next: Felipe Contreras
Message 1 of 9 in “Feature idea: git rebase --exec $CMD”
  1. Antonio OspiteMay 5, 2012
  2. Felipe ContrerasMay 5, 2012
  3. Matthieu MoyMay 6, 2012
  4. Antonio OspiteMay 6, 2012
  5. Jeff KingMay 6, 2012
  6. Matthieu MoyMay 10, 2012
  7. dag@cray.comMay 23, 2012
  8. Matthieu MoyMay 23, 2012
  9. dag@cray.comMay 23, 2012

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.