cherry-pick: don't barf when there's nothing to do

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
cherry-pick: add --skip-empty option

Pretty much what it says on the tin.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
revert/cherry-pick: add --quiet option

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
revert/cherry-pick: add --skip option

Akin to 'am --skip' and 'rebase --skip'.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
builtin: add rewrite helper

So that we can load and store rewrites, as well as other operations on a
list of rewritten commits.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
cherry-pick: store rewritten commits

Will be useful for the next commits.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
cherry-pick: don't store skipped commit

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
builtin: move run_rewrite_hook() to rewrite.c

And use struct rewrite.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
builtin: rewrite: add copy_rewrite_notes()

And use it on commit.c.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
cherry-pick: add --action-name option

So it can be used by other tools (e.g. git rebase), and the right action
is passed to the hooks and notes rewrite stuff.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
cherry-pick: copy notes and run hooks

If no action-name is specified, nothing is done.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
cherry-pick: remember rerere-autoupdate

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
rebase: split the cherry-pick stuff

They do something completely different from 'git am', it belongs in a
different file.

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
rebase: cherry-pick: fix mode storage

We don't use the 'rebase-apply'.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
rebase: cherry-pick: fix sequence continuation

We are not in am mode.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
rebase: cherry-pick: fix abort of cherry mode

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
rebase: cherry-pick: fix command invocations

So that all the tests pass.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
rebase: cherry-pick: fix status messages

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
rebase: cherry-pick: automatically commit stage

When there's changes in the staging area. Just like the other rebase
modes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
rebase: cherry-pick: set correct action-name

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>