Smokin' Git Rebase (DCBPW)

Original abstract

This lightning talk will show you why and how to smoke test your git rebase. Git rebase is a great tool, but you lose confidence in having tested every commit once you rewrite them. This talk shows a clever way to smoke test during the rebase itself, so you can stop and fix any failures as you go.

Details of the technique

The slides are a bit useless without audio/video, but the key technique is on pages 22-24 and repeated here:

  • After rebasing lots of work, start a new iteractive rebase
  • Set all commits to “edit”
  • When git drops you into the shell for the first commit, run the following command – it will stop if tests fail so you can fix up the failing commit.
smoke-rebase ()
{
  while true; do
    ( perl Makefile.PL &&    \
      make realclean   &&    \
      perl Makefile.PL &&    \
    ) >&/dev/null            \
    && make test             \
    && git rebase --continue \
    || break
  done
}
  • Once fixed and committed, re-run the command to test and continue.

Slides

Download PDF