Re: Feature idea: git rebase --exec $CMD
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:53:53
[off-list ref] writes:
Antonio Ospite [off-list ref] writes:quoted
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.I've taken a more general approach inspired by run-command-on-git-revisions at https://github.com/garybernhardt/dotfiles/tree/master/bin I took that and turned it into a git-run-command subcommand. It will take an arbitrary command and run it on each revision specified by a revlist.
That's sensible too. The nice things with running commands in "git rebase" are: * It's likely to be the place where you want to run some tests. The typical use-case is that you have a patch serie whose last revision passes tests, and you want to check that intermediate commits also do. At that point, you probably want to rebase against upstream too, to make sure you're developping against the latest revision, before sening a patch serie or pushing. * if the "exec" command fails, you're likely to be exactly in the right place to fix it: fix the bug, run "git commit --amend", and "git rebase --continue". The nice thing with your approach (as I understand it) is that it doesn't require rewritting history, and may apply to all commits in non-linear history. -- Matthieu Moy http://www-verimag.imag.fr/~moy/