Initial version of shears.sh
commit95ae63b8c6c0b275f460897c15a44a7df5246dfb
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 16 Dec 2013 04:22:29 +0000 (15 22:22 -0600)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 26 Dec 2013 18:31:48 +0000 (26 12:31 -0600)
tree8725d62b88caac651fa93c8f8d6f3b75a0bfb178
parent7046b44a2ab6a906a99e6a2928e3a848c19c4a30
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>
share/msysGit/shears.sh [new file with mode: 0755]