Matthew Flaschen mflaschen@wikimedia.org wrote:
[...]
Note that this is a shitty bash script (to put it mildly) - but that seems to be all I can write at 5:30 AM :) I'll probably rewrite it to be a proper python one soon. That should also allow me to use the GitHub API to also mirror the GitHub Pull Request Title / Description to Gerrit.
Also, force-removing the rebase-apply directory is worrisome. I think most or all of the rebase commands have --abort options. If a rebase is in progress, can you exit and prompt the user to finish or abort, rather than blowing it apply?
The nice thing about Git is that you can create new workspaces at little cost -- "git clone --reference $LOCALREPO $GERRITURL $TEMPDIR" (or "git clone $LOCALREPO $TEMPDIR" if $LOCALREPO is up-to-date) will give you a clean checkout in $TEMPDIR, where you can then easily run all kinds of rebases, squashes and whatnot, and when you either have pushed the resulting commit to Gerrit or aborted be- cause you ran into some problems, you can just remove the whole directory. No need to worry about the state of your working copy or how you might mess up your branches, stashes & Co.
Tim