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>
revert/cherry-pick: cleanup rerere info on --abort

As we should.

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

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>
completion: graduate out of contrib

These have been stable and widely used for quite a long time, they even
have tests outside of the contrib area, and most distributions ship
them, so they can be considered part of the core already.

We should be consistent and either we move the tests to contrib, or we
move the completions out of contrib.

Let's move them out of contrib and install them by default.

By default bash-completion installs the completions to
$(pkgdatadir)/completions, which is
$(prefix)/share/bash-completion/completions. And since most distributions do
not change this, it is obviously the right default. However,
bash-completion recommends to use pkg-config to find the right location,
so we could use that, but it's much easier to let distributions do it:

  bashcomdir=$pkg-config --variable=completionsdir bash-completion)

By default zsh looks for completions in
$(prefix)/share/zsh/site-functions.

The distributions use these locations to install Git completions:

  ArchLinux: /usr/share/bash-completion/completions/
  Debian: /usr/share/bash-completion/completions/
  Fedora: /etc/bash_completion.d/
  Ubuntu: /usr/share/bash-completion/completions/
  Mint: /usr/share/bash-completion/completions/
  OpenSuse: /etc/bash_completion.d/

However, in both Fedora and OpenSUSE their bash-completion intallations
use /usr/share/bash-completion/completions/ (they don't change the
default). So it  seems to a be a bug from the packager, since they
recommend the bash-completion location[1]

If some weird distribution has a problem with the location, they can
override 'bashcompdir' anyway.

[1] http://article.gmane.org/gmane.linux.redhat.fedora.devel/177405

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Merge branch 'fc/cherry-pick'

* fc/cherry-pick:
  cherry-pick: copy notes and run hooks
  cherry-pick: add --action-name option
  builtin: rewrite: add copy_rewrite_notes()
  builtin: move run_rewrite_hook() to rewrite.c
  cherry-pick: don't store skipped commit
  cherry-pick: store rewritten commits
  builtin: add rewrite helper
  cherry-pick: remember rerere-autoupdate
  revert/cherry-pick: cleanup rerere info on --abort
  revert/cherry-pick: add --skip option
  revert/cherry-pick: add --quiet option
  cherry-pick: add --skip-empty option
  cherry-pick: don't barf when there's nothing to do