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.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
shears.sh: support fixup! and squash!

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
shears.sh: simplify marking rewritten commits

It is nicer to read

	mark deadbeef

than

	exec git update-ref refs/rewritten/deadbeef HEAD

not to mention easier to write when modifying the edit script.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
shears.sh: make merge nicer to use

When modifying edit scripts, it is quite convenient to be able to
split branches by inserting

	mark my-new-branch
	exec git reset --hard refs/rewritten/onto

and later just adding the line

	merge my-new-branch

A later commit will simplify this even further.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
shears.sh: provide hints as to branch names

It is quite convenient to know what branch is started by a

	exec git reset --hard refs/rewritten/onto

so let's try hard to find a branch name for each of them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
shears.sh: introduce 'bud' and 'finish' commands

The most common operations during splitting a bunch of commits into
neatly-packaged topic branches are:

1) 'finish': name a branch & mark it for merging at the end, and

2) 'bud': start a new branch from the 'onto' commit

For example, when given an edit script

	pick abcdef Adds an initial README.md file
	pick 012345 Adds a FAQ section to the README
	pick 987654 Fix an off-by-one bug

you might want to put the first two commits into the 'readme' branch
while the third commit wants to live in the 'fixes' branch. Voila:

	pick abcdef Adds an initial README.md file
	pick 012345 Adds a FAQ section to the README
	finish readme

	pick 987654 Fix an off-by-one bug
	finish fixes

Since 'finish' implies a 'bud', this will result in a rewritten
history like this:

	* 3141592 Merge 'fixes' into HEAD
	|\
	| * cafebabe Fix an off-by-one bug
	* |  badf00d Merge 'readme' into HEAD
	|\ \
	| * | c0eddad Adds a FAQ section to the README
	| * | d1bad00 Adds an initial README.md file
	|/ /
	o-' fa7d00d Start the merging-rebase

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
shears.sh: introduce --recrate=<merge-commit> option

This option will try to recreate the branch that was merged by the
specified commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
shears.sh: delete existing rewritten refs with --force

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Use the garden shears in merging-rebase.sh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>