All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Ian Ward Comfort <icomfort@stanford.edu>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] bash: complete *_HEAD refs if present
Date: Wed, 17 Mar 2010 08:40:20 -0700	[thread overview]
Message-ID: <20100317154020.GD1871@spearce.org> (raw)
In-Reply-To: <1268817635-7946-1-git-send-email-icomfort@stanford.edu>

Ian Ward Comfort <icomfort@stanford.edu> wrote:
> We already complete HEAD, of course, and might as well complete the other
> common refs mentioned in the rev-parse man page: FETCH_HEAD, ORIG_HEAD, and
> MERGE_HEAD.

Acked-by: Shawn O. Pearce <spearce@spearce.org>

 
> Signed-off-by: Ian Ward Comfort <icomfort@stanford.edu>
> ---
>  contrib/completion/git-completion.bash |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index fe93747..733ac39 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -250,7 +250,9 @@ __git_refs ()
>  			refs="${cur%/*}"
>  			;;
>  		*)
> -			if [ -e "$dir/HEAD" ]; then echo HEAD; fi
> +			for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do
> +				if [ -e "$dir/$i" ]; then echo $i; fi
> +			done
>  			format="refname:short"
>  			refs="refs/tags refs/heads refs/remotes"
>  			;;

-- 
Shawn.

      reply	other threads:[~2010-03-17 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17  9:20 [PATCH] bash: complete *_HEAD refs if present Ian Ward Comfort
2010-03-17 15:40 ` Shawn O. 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=20100317154020.GD1871@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=icomfort@stanford.edu \
    /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.