There is a bash completion script included in the git tarball. I think it would be very handy to install this, or at the least include it in %doc so users could add it. Considering that the git-foo commands are deprecated and users are encouraged to use git foo, having bash completion for all of git's commands would be a big help. I'll attach a patch against the current spec file that adds a git-completion subpackage. If you'd rather not create another subpackage, I'd be happy to roll this in where ever you'd like (and I won't even start a long thread on fedora-devel to rant about it ;). Also included in this patch are a bunch of small fixes for things rpmlint bitches about. That makes the patch look more invasive than it really is. If you skip the whitespace, there are only 30 insertions and 4 deletions. I included a changelog with the patch just to document what I did. I don't mind taking the blame if I broke it, but I don't particularly care about the credit.
Created attachment 295137 [details] patch to add a git-completion subpackage and fix some rpmlint warnings.
Created attachment 295722 [details] updated patch to add a git-completion subpackage and fix some rpmlint warnings. Here's an updated patch against git-1.5.4.3-1, with the git-core -> git rename.
Created attachment 295744 [details] updated patch to add a git-completion subpackage and fix some rpmlint warnings. Updated patch again to remove the %config(noreplace) setting for gitweb config file. That change was just made in bug #434693.
Created attachment 298305 [details] updated patch to add a git-completion subpackage and fix some rpmlint warnings. Updated to apply cleanly against git-1.5.4.4-1. Is there any interest in including the bash completion script? The git dash commands have been deprecated since ~2006 and are scheduled to be moved out of $PATH in git-1.6.0. Having bash completion that helps/encourages users to learn git in the proper git <command> form seems like a good thing.
Hi Todd: For git-1.5.4.4-3 I've got the completion script installing in the core git package, rather than in its own completion subpackage (which seems to be the way packages go in fedora). Thanks for the patches though ;)
James, Thanks for adding this. :) A minor nit, but shouldn't you either Require: bash-completion or own %{_sysconfdir}/bash_completion.d ? I've seen packages do both. There are multiple packages in fedora that own %{_sysconfdir}/bash_completion.d. I've wanted to ask the FPC folks if there's a preference on this. I think having the dep on bash-completion is excessive, so I'd go for something like this: -%{_sysconfdir}/bash_completion.d/git +%dir %{_sysconfdir}/bash_completion.d +%config(noreplace) %{_sysconfdir}/bash_completion.d/git
(In reply to comment #6) > James, > > Thanks for adding this. :) > > A minor nit, but shouldn't you either Require: bash-completion or own > %{_sysconfdir}/bash_completion.d ? I've seen packages do both. There are > multiple packages in fedora that own %{_sysconfdir}/bash_completion.d. I've > wanted to ask the FPC folks if there's a preference on this. I think having the > dep on bash-completion is excessive, so I'd go for something like this: > > -%{_sysconfdir}/bash_completion.d/git > +%dir %{_sysconfdir}/bash_completion.d > +%config(noreplace) %{_sysconfdir}/bash_completion.d/git Sounds good to me; I'll get git owning the dir and rebuild