Initial version of shears.sh
The purpose of the garden shears is to provide a much more advanced way
to work with a thicket of development branches than an interactive,
merge-preserving rebase. It supports not only rebasing topic branches
while keeping their merge structure intact but also allows for
reordering commits, as well as integrating msysGit's 'merging rebase'
strategy.
To support all that, this introduces a couple of new "rebase commands"
that are translated after editing the edit script, making use of a
temporary alias called ".r" that simply calls shears.sh itself.
The new commands are: "merge", "start_merging_rebase" and "cleanup".
To make appropriate use of those new commands, we refuse blatantly to
let "git rebase -p" write the edit script, but generate it ourselves
instead. As a consequence, the edit scripts look very different from
current 'rebase -p' scripts.
Example:
start_merging_rebase "
2fb434d"
exec git update-ref refs/rewritten/onto HEAD
exec git reset --hard refs/rewritten/onto
pick
780e6c6 Add a ZipInputStream
exec git update-ref refs/rewritten/
780e6c6 HEAD
exec git reset --hard refs/rewritten/onto
merge refs/rewritten/
780e6c6 -C
2fb434d # Merge branch 'zip-input-stream' into HEAD
cleanup
780e6c6
Subsequent commits will improve this script further.
Since this developer designed git-rebase's --preserve-merges support in
a very unfortunate, awfully short-sighted manner, it was sadly not
possible to provide this functionality as a patch series improving
git-rebase--interactive itself, but it is rather an add-on script that
circumvents parts of git-rebase--interactive altogether.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>