I would be nice if shells/bash-completion also include completion for git out of the box. Currently user have to add it manually like this: ``` cd /usr/local/share/bash-completion/completions/ sudo wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -O git ``` git-completion.bash is a very powerful thing. Not only `git me[Tab]` completes to `git merge` but also `git checkout optional_prefix_[Tab]` suggest branch names and remotes, and stuff like that.
As a side note, port probably could use a set of Ubuntu's completion scripts instead of Debian's. It already includes git completion and probably other scripts.
Mmmm, you don't need to go and fetch it from the web, if you install git, it is available in /usr/local/share/git-core/contrib/completion/git-completion.bash. It would be nice if git installed it at the right place though.
I'm using git-lite binary package. Apparently it doesn't include bach completion. Interestingly it doesn't look much lighter than regular git package (+24 Mb, a few additional Perl modules, nothing fancy). Maybe I should just use it instead of git-lite.
Created attachment 174287 [details] patch The patch does two things: - split targets so that they use options helpers when possible - Always install the completions to some useful place. if CONTRIB is on, symlink them in the right place. if CONTRIB is off, copy the anyway.
CONTRIB has lots of build-time dependencies, and I don't think that having completions should depend on them. If the completions are going to be installed, why not just install them into the right place always?
Also, Aleksander, can you please file a separate PR about comment #1, switching to the Ubuntu completion scripts? Along with some links if you have them. Thanks.
Oh, I misread mat's patch. It does the right thing. I definitely vote in favour of applying mat's patch. Renato, do you have input/opinion here?
Renato can you give an up or down vote on Mat's patch please?
Oh, I had forgotten about this one, committed.
A commit references this bug: Author: mat Date: Tue Nov 15 08:43:10 UTC 2016 New revision: 426150 URL: https://svnweb.freebsd.org/changeset/ports/426150 Log: Split targets so that they use options helpers when possible. Always install the completions to some useful place. [1] if CONTRIB is on, symlink them in the right place. if CONTRIB is off, copy the anyway. PR: 212303 Submitted by: mat Reported by: Aleksander Alekseev [1] Approved by: maintainer timeout Sponsored by: Absolight Changes: head/devel/git/Makefile head/devel/git/pkg-plist