completion: graduate out of contrib
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 3 May 2014 00:28:16 +0000 (19:28 -0500)
committerFelipe Contreras <felipe.contreras@gmail.com>
Sat, 24 May 2014 00:15:47 +0000 (19:15 -0500)
commit2fadd70cd8112ca54ddfb43745a93d300d8bdb2c
treed56cac0c42144faab4fc4691888889814cd9d2e1
parentfaddd5131d7369c590d66c07e5ddea5035348c24
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>
Makefile
shared/git-completion.bash [moved from contrib/completion/git-completion.bash with 100% similarity]
shared/git-completion.zsh [moved from contrib/completion/git-completion.zsh with 100% similarity]
shared/git-prompt.sh [moved from contrib/completion/git-prompt.sh with 100% similarity]
t/t9902-completion.sh
t/t9903-bash-prompt.sh