shears.sh: introduce 'bud' and 'finish' commands
commitc6de36b9480f6b9c34a3a3bb5ff224eed3de0301
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 20 Dec 2013 02:39:26 +0000 (19 20:39 -0600)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 28 Dec 2013 00:02:04 +0000 (27 18:02 -0600)
treeb9bd96a11764e431d4642e78128b16f8059ce356
parent742033ee55cb18d27794304971552c235e82b0df
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

Since multiple branches most often want to branch off from a common base
commit, the 'finish' command implies a 'bud' after marking the HEAD for
later merging.

For example, when given an edit script as this:

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. This can be
accomplished by inserting two 'finish' lines:

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>
share/msysGit/shears.sh