Re: [PATCH] Contributed bash completion support for core Git tools.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sebastian Harl <sh@xxxxxxxxxx> wrote:
> Hi,
> 
> > This is a set of bash completion routines for many of the
> > popular core Git tools.  I wrote these routines from scratch
> > after reading the git-compl and git-compl-lib routines available
> > from the gitcompletion package at http://gitweb.hawaga.org.uk/
> > and found those to be lacking in functionality for some commands.
> 
> Did you talk to Ben Clifford (the maintainer of these scripts) before?

No.  I found his scripts yesterday, played around with them for
about 15 minutes and found them to be missing some features.
In particular they don't actually list all branch names as they
only list only those contained directly in refs/heads.  This is
certainly very annoying when your topic branch policy uses "sp/",
"jh/", "lt/" as branch name prefixes.  It also won't work with Linus'
new packed ref format...

Ben's scripts also don't always complete tags at points where Git
accepts a tag, nor can they complete through a path with git diff
or git cat-file to yank a file out of another branch which doesn't
exist in the current working directory.  They also can't complete
branch names in a remote repository when you are fetching or pushing.

So I set out to write my own, finished it in less than an hour,
used it for 4 hours while doing some merging, and sent an email to
put the script into contrib.  :-)

> His scripts seem to be in pretty wide-spread use already, so it might
> make sense to join efforts and improve his scripts (and get them
> into git-core).

Agreed.  There may be a few things my script is lacking but I
think the one I sent yesterday is already more powerful than Ben's.
But I'd like to see it be smarter about completion context and do
even more.  But right now I'm happy as it can complete my topic
branch names and tag names.

I'd like to see core Git at least carry the completion for core Git.
I know Ben has support for StGit and Cogito as well; two packages
that my script doesn't support.  In my humble opnion the completion
scripts should migrate into the packages they support.  I don't
think its unreasonable to expect bash completion support to be part
of a popular package which is heavily dependent on the shell for
its user interface[*1*].

> > Consequently there may be some similarities but many differences.
> 
> Do you know of any (incompatible) differences?

None that I can think of.  I believe that my script will complete
anything Ben's does with the exception of a stray single character
option here or there.

You can't load both into your shell at the same time as bash will
only accept one completion function for any given command and both
packages use the same function names to implement the completion
logic.


[*1*] So long as there is someone to maintain it anyway.  :-)

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]