git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bash completion: Add long options for 'git describe'
@ 2008-07-25 10:02 Thomas Rast
  2008-07-25 13:15 ` SZEDER Gábor
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Rast @ 2008-07-25 10:02 UTC (permalink / raw)
  To: git; +Cc: gitster, Shawn O. Pearce

---

It seemed so tedious to type --always so I wrote this instead ;-)

 contrib/completion/git-completion.bash |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 3b04934..421431c 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -665,6 +665,17 @@ _git_commit ()
 
 _git_describe ()
 {
+	__git_has_doubledash && return
+
+	local cur="${COMP_WORDS[COMP_CWORD]}"
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--all --tags --contains --abbrev= --candidates=
+			--exact-match --debug --long --match --always
+			"
+		return
+	esac
 	__gitcomp "$(__git_refs)"
 }
 
-- 
1.6.0.rc0.48.g3fa0a

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] bash completion: Add long options for 'git describe'
  2008-07-25 10:02 [PATCH] bash completion: Add long options for 'git describe' Thomas Rast
@ 2008-07-25 13:15 ` SZEDER Gábor
  2008-07-25 16:20   ` Shawn O. Pearce
  0 siblings, 1 reply; 6+ messages in thread
From: SZEDER Gábor @ 2008-07-25 13:15 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, gitster, Shawn O. Pearce

Hi,

On Fri, Jul 25, 2008 at 12:02:50PM +0200, Thomas Rast wrote:
> ---
Signed off by?

>  _git_describe ()
>  {
> +	__git_has_doubledash && return
This line is superfluous, because 'git describe' does not have any path
arguments.

Gábor

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bash completion: Add long options for 'git describe'
  2008-07-25 13:15 ` SZEDER Gábor
@ 2008-07-25 16:20   ` Shawn O. Pearce
  2008-07-26 10:25     ` Thomas Rast
  2008-07-26 10:26     ` Thomas Rast
  0 siblings, 2 replies; 6+ messages in thread
From: Shawn O. Pearce @ 2008-07-25 16:20 UTC (permalink / raw)
  To: Thomas Rast; +Cc: SZEDER GGGbor, git, gitster

SZEDER GGGbor <szeder@ira.uka.de> wrote:
> On Fri, Jul 25, 2008 at 12:02:50PM +0200, Thomas Rast wrote:
> > ---
> Signed off by?
> 
> >  _git_describe ()
> >  {
> > +	__git_has_doubledash && return
> This line is superfluous, because 'git describe' does not have any path
> arguments.

Yup.  Aside from the two items described above (mising SOB line
and the unnecessary double dash test) this patch looks fine.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bash completion: Add long options for 'git describe'
  2008-07-25 16:20   ` Shawn O. Pearce
@ 2008-07-26 10:25     ` Thomas Rast
  2008-07-26 10:26     ` Thomas Rast
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Rast @ 2008-07-26 10:25 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: SZEDER GGGbor, git, gitster

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

Shawn O. Pearce wrote:
> SZEDER GGGbor <szeder@ira.uka.de> wrote:
> > >  _git_describe ()
> > >  {
> > > +	__git_has_doubledash && return
> > This line is superfluous, because 'git describe' does not have any path
> > arguments.
> 
> Yup.  Aside from the two items described above (mising SOB line
> and the unnecessary double dash test) this patch looks fine.

I suppose you're right.  It does (empirically) attempt to parse
anything following a -- as a revision argument, but similar commands
like cherry-pick don't handle the -- specially either.

I'll resend a fixed version.

- Thomas

-- 
Thomas Rast
trast@student.ethz.ch


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] bash completion: Add long options for 'git describe'
  2008-07-25 16:20   ` Shawn O. Pearce
  2008-07-26 10:25     ` Thomas Rast
@ 2008-07-26 10:26     ` Thomas Rast
  2008-07-26 21:52       ` Shawn O. Pearce
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Rast @ 2008-07-26 10:26 UTC (permalink / raw)
  To: git; +Cc: gitster, Shawn O. Pearce, SZEDER Gábor

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 contrib/completion/git-completion.bash |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 3b04934..4ae8b36 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -665,6 +665,15 @@ _git_commit ()
 
 _git_describe ()
 {
+	local cur="${COMP_WORDS[COMP_CWORD]}"
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--all --tags --contains --abbrev= --candidates=
+			--exact-match --debug --long --match --always
+			"
+		return
+	esac
 	__gitcomp "$(__git_refs)"
 }
 
-- 
1.6.0.rc0.50.g6a66e

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] bash completion: Add long options for 'git describe'
  2008-07-26 10:26     ` Thomas Rast
@ 2008-07-26 21:52       ` Shawn O. Pearce
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn O. Pearce @ 2008-07-26 21:52 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, gitster, SZEDER GGGbor

Thomas Rast <trast@student.ethz.ch> wrote:
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>

Much shorter, thanks.

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

> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 3b04934..4ae8b36 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -665,6 +665,15 @@ _git_commit ()
>  
>  _git_describe ()
>  {
> +	local cur="${COMP_WORDS[COMP_CWORD]}"
> +	case "$cur" in
> +	--*)
> +		__gitcomp "
> +			--all --tags --contains --abbrev= --candidates=
> +			--exact-match --debug --long --match --always
> +			"
> +		return
> +	esac
>  	__gitcomp "$(__git_refs)"
>  }
>  

-- 
Shawn.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-07-26 21:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-25 10:02 [PATCH] bash completion: Add long options for 'git describe' Thomas Rast
2008-07-25 13:15 ` SZEDER Gábor
2008-07-25 16:20   ` Shawn O. Pearce
2008-07-26 10:25     ` Thomas Rast
2008-07-26 10:26     ` Thomas Rast
2008-07-26 21:52       ` 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).