completion: graduate out of contrib felipec/fc/comp/graduate
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 3 May 2014 00:28:16 +0000 (19:28 -0500)
committerFelipe Contreras <felipe.contreras@gmail.com>
Thu, 19 May 2016 00:01:41 +0000 (19:01 -0500)
commit870c2a078017cd05a1a94a268c0ca629e44b8412
tree6e0a6dfd8d805d052be7c93f75132db00b5a744b
parent90f7b16b3adc78d4bbabbd426fb69aa78c714f71
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