Bug 433255 - Include bash completion for git (patch attached)
Summary: Include bash completion for git (patch attached)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: git
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Chris Wright
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-02-18 06:40 UTC by Todd Zullinger
Modified: 2013-01-10 10:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-26 12:59:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch to add a git-completion subpackage and fix some rpmlint warnings. (7.85 KB, patch)
2008-02-18 06:40 UTC, Todd Zullinger
no flags Details | Diff
updated patch to add a git-completion subpackage and fix some rpmlint warnings. (7.99 KB, patch)
2008-02-23 23:31 UTC, Todd Zullinger
no flags Details | Diff
updated patch to add a git-completion subpackage and fix some rpmlint warnings. (2.32 KB, patch)
2008-02-24 18:05 UTC, Todd Zullinger
no flags Details | Diff
updated patch to add a git-completion subpackage and fix some rpmlint warnings. (7.56 KB, patch)
2008-03-17 20:36 UTC, Todd Zullinger
no flags Details | Diff

Description Todd Zullinger 2008-02-18 06:40:53 UTC
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.

Comment 1 Todd Zullinger 2008-02-18 06:40:53 UTC
Created attachment 295137 [details]
patch to add a git-completion subpackage and fix some rpmlint warnings.

Comment 2 Todd Zullinger 2008-02-23 23:31:52 UTC
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.

Comment 3 Todd Zullinger 2008-02-24 18:05:02 UTC
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.

Comment 4 Todd Zullinger 2008-03-17 20:36:37 UTC
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.

Comment 5 James Bowes 2008-03-26 12:59:54 UTC
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 ;)

Comment 6 Todd Zullinger 2008-03-26 18:00:22 UTC
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

Comment 7 James Bowes 2008-03-27 00:05:54 UTC
(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


Note You need to log in before you can comment on or make changes to this bug.