Initial version of rebaser.sh

The purpose of the rebaser is to be a slightly more advanced version of
an interactive, merge-preserving rebase. It supports not only rebasing
topic branches, 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"
by installing a temporary alias called ".r" that simply calls rebaser.sh
with one of the following commands: "merge", "start_merging_rebase" and
"cleanup". As a consequence, the edit scripts look very different from
current 'rebase -p' scripts.

Example:

	exec git .r 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
	exec git .r merge refs/rewritten/780e6c6 -C 2fb434d # Merge branch 'zip-input-stream' into HEAD

	exec git .r 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 itself, but it is rather an add-on script that circumvents
parts of git-rebase.

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

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

It is nicer to read

	exec git .r 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>
rebaser.sh: make merge nicer to use

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

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

and later just adding the line

	exec git .r merge my-new-branch

A later commit will simplify this even further.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
rebaser.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>
rebaser.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
	exec git .r finish readme

	pick 987654 Fix an off-by-one bug
	exec git .r 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>
Use the rebaser in merging-rebase.sh

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