git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Sebastian Harl <sh@tokkee.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Contributed bash completion support for core Git tools.
Date: Mon, 18 Sep 2006 13:55:09 -0400	[thread overview]
Message-ID: <20060918175509.GD31140@spearce.org> (raw)
In-Reply-To: <20060918083114.GQ20913@albany.tokkee.org>

Sebastian Harl <sh@tokkee.org> 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.

      reply	other threads:[~2006-09-18 17:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-18  0:48 [PATCH] Contributed bash completion support for core Git tools Shawn Pearce
2006-09-18  1:03 ` Junio C Hamano
2006-09-18  1:18   ` Shawn Pearce
2006-09-28 16:16     ` Junio C Hamano
2006-09-28 16:28       ` Shawn Pearce
2006-09-18  8:17 ` Johannes Schindelin
2006-09-18 17:29   ` Shawn Pearce
2006-09-18  8:23 ` Junio C Hamano
2006-09-18 17:42   ` Shawn Pearce
2006-09-18  8:31 ` Sebastian Harl
2006-09-18 17:55   ` Shawn Pearce [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060918175509.GD31140@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=sh@tokkee.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).