All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Andreas Ericsson <ae@op5.se>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Junio C Hamano <gitster@pobox.com>, Petr Baudis <pasky@suse.cz>,
	git@vger.kernel.org
Subject: Re: [PATCH] bash completion: Fix the . -> .. revision range completion
Date: Tue, 15 Jul 2008 23:38:51 +0000	[thread overview]
Message-ID: <20080715233851.GA23672@spearce.org> (raw)
In-Reply-To: <487C5A2D.3000707@op5.se>

Andreas Ericsson <ae@op5.se> wrote:
> I beat you to it ;-) This works just fine for me regardless of whether
> or not I have a colon in COMP_WORDBREAKS.
...
> Subject: git-completion.bash: Handle "rev:path" completion properly
...
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index d268e6f..e138022 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -293,7 +293,11 @@ __git_complete_file ()
> 		*)
> 			ls="$ref"
> 			;;
> -	    esac
> +		esac
> +		# When completing something like 'rev:path', bash behaves
> +		# differently whether or not COMP_WORDBREAKS contains a
> +		# colon or not. This lets it handle both cases
> +		test "${COMP_WORDBREAKS//:}" = "$COMP_WORDBREAKS" && pfx="$ref:$pfx"
> 		COMPREPLY=($(compgen -P "$pfx" \
> 			-W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
> 				| sed '/^100... blob /s,^.*	,,

Yea, I did more or less the same thing in my patch, but I also
handled this fix in git-fetch and git-push.  The : is also used
there in a refspec and we support completion the right side of the
: in both cases (and yes, on git-push that can be slow as we do
network IO, possibly over SSH).

So I'm in favor of my patch over yours, but only because of
the fetch and push fixes as well.

-- 
Shawn.

  parent reply	other threads:[~2008-07-15 23:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-13 11:19 [PATCH] bash completion: Fix the . -> .. revision range completion Petr Baudis
2008-07-13 12:11 ` Jakub Narebski
2008-07-13 21:38 ` Junio C Hamano
2008-07-13 22:06   ` Shawn O. Pearce
2008-07-13 23:07   ` Petr Baudis
2008-07-13 23:25     ` Junio C Hamano
2008-07-13 23:52       ` Linus Torvalds
2008-07-14  0:00         ` Shawn O. Pearce
2008-07-14  5:38           ` Linus Torvalds
2008-07-14  5:57             ` Shawn O. Pearce
2008-07-14  6:27             ` Shawn O. Pearce
2008-07-14  6:47               ` Björn Steinbrink
2008-07-14  6:50                 ` Björn Steinbrink
2008-07-14 12:39                   ` Andreas Ericsson
2008-07-14 14:51                   ` Linus Torvalds
2008-07-14 14:50               ` Linus Torvalds
2008-07-15  4:25                 ` Shawn O. Pearce
2008-07-15  8:05                   ` Andreas Ericsson
2008-07-15  8:10                     ` Andreas Ericsson
2008-07-15  8:17                       ` Andreas Ericsson
2008-07-15 23:38                     ` Shawn O. Pearce [this message]
2008-07-16  7:20                       ` Andreas Ericsson

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=20080715233851.GA23672@spearce.org \
    --to=spearce@spearce.org \
    --cc=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pasky@suse.cz \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.