* [PATCH] bash: complete *_HEAD refs if present
@ 2010-03-17 9:20 Ian Ward Comfort
2010-03-17 15:40 ` Shawn O. Pearce
0 siblings, 1 reply; 2+ messages in thread
From: Ian Ward Comfort @ 2010-03-17 9:20 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
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.
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"
;;
--
1.7.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bash: complete *_HEAD refs if present
2010-03-17 9:20 [PATCH] bash: complete *_HEAD refs if present Ian Ward Comfort
@ 2010-03-17 15:40 ` Shawn O. Pearce
0 siblings, 0 replies; 2+ messages in thread
From: Shawn O. Pearce @ 2010-03-17 15:40 UTC (permalink / raw)
To: Ian Ward Comfort; +Cc: git
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-17 15:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-17 9:20 [PATCH] bash: complete *_HEAD refs if present Ian Ward Comfort
2010-03-17 15:40 ` Shawn O. Pearce
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).