threads / patch / 41295

patchcompletion: verify-tag is not plumbing

Subject: [PATCH] completion: verify-tag is not plumbing

## tl;dr

4 messages between Jan 31, 2016 and Feb 1, 2016. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

John Keeping· Jan 31, 2016, 12:44 UTC · lore

According to command-list.txt, verify-tag is an ancillary interrogator, which means that it should be completed by "git verify-<TAB>" in the same way as verify-commit.

Remove it from the list of plumbing commands so that it is treated as porcelain and completed.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 contrib/completion/git-completion.bash | 1 -
 1 file changed, 1 deletion(-)
Show changes to contrib/completion/git-completion.bash +0 −1
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 51f5223..250788a 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -728,7 +728,6 @@ __git_list_porcelain_commands ()
 		write-tree)       : plumbing;;
 		var)              : infrequent;;
 		verify-pack)      : infrequent;;
-		verify-tag)       : plumbing;;
 		*) echo $i;;
 		esac
 	done
-- 
2.7.0
SZEDER Gábor· Jan 31, 2016, 13:37 UTC · re: John Keeping · lore

Re: [PATCH] completion: verify-tag is not plumbing

Quoting John Keeping <john@keeping.me.uk>:
Show 6 quoted lines
> According to command-list.txt, verify-tag is an ancillary interrogator,
> which means that it should be completed by "git verify-<TAB>" in the
> same way as verify-commit.
>
> Remove it from the list of plumbing commands so that it is treated as
> porcelain and completed.

I'm not sure. There are commands among the ancillary interrogators that are basically porcelains (e.g. blame), while some are more like plumbing (e.g. rerere, rev-parse). In general the completion script supports the former but not the latter commands.

Now, the real porcelain-ish way to verify a tag is via 'git tag -v|--verify', and according to a925c6f165a3 (bash: Classify more commends out of completion., 2007-02-04), the commit removing verify-tag from the completed commands, verify-tag was kept around for backwards compatibility reasons. OTOH verify-commit was introduced in d07b00b7f31d (verify-commit: scriptable commit signature verification, 2014-06-23), and as the subject line states it was intended more as a plumbing command.

So I think we should keep excluding verify-tag from the list of porcelain commands in the completion script, and it was an oversight not to exclude verify-commit as well when it was introduced.

Gábor
Show 20 quoted lines
> Signed-off-by: John Keeping <john@keeping.me.uk>
> ---
>  contrib/completion/git-completion.bash | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/contrib/completion/git-completion.bash  
> b/contrib/completion/git-completion.bash
> index 51f5223..250788a 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -728,7 +728,6 @@ __git_list_porcelain_commands ()
>  		write-tree)       : plumbing;;
>  		var)              : infrequent;;
>  		verify-pack)      : infrequent;;
> -		verify-tag)       : plumbing;;
>  		*) echo $i;;
>  		esac
>  	done
> -- 
> 2.7.0
John Keeping· Feb 1, 2016, 10:44 UTC · re: SZEDER Gábor · lore

Re: [PATCH] completion: verify-tag is not plumbing

On Sun, Jan 31, 2016 at 02:37:59PM +0100, SZEDER Gábor wrote:
Show 27 quoted lines
> 
> Quoting John Keeping <john@keeping.me.uk>:
> 
> > According to command-list.txt, verify-tag is an ancillary interrogator,
> > which means that it should be completed by "git verify-<TAB>" in the
> > same way as verify-commit.
> >
> > Remove it from the list of plumbing commands so that it is treated as
> > porcelain and completed.
> 
> I'm not sure.  There are commands among the ancillary interrogators
> that are basically porcelains (e.g. blame), while some are more like
> plumbing (e.g. rerere, rev-parse).  In general the completion script
> supports the former but not the latter commands.
> 
> Now, the real porcelain-ish way to verify a tag is via 'git tag
> -v|--verify', and according to a925c6f165a3 (bash: Classify more
> commends out of completion., 2007-02-04), the commit removing
> verify-tag from the completed commands, verify-tag was kept around for
> backwards compatibility reasons.  OTOH verify-commit was introduced in
> d07b00b7f31d (verify-commit: scriptable commit signature verification,
> 2014-06-23), and as the subject line states it was intended more as a
> plumbing command.
> 
> So I think we should keep excluding verify-tag from the list of
> porcelain commands in the completion script, and it was an oversight
> not to exclude verify-commit as well when it was introduced.

I can accept that argument about verify-commit and verify-tag, but listing verify-tag as plumbing is incorrect according to command-list.txt (and thus git(1)). If we're going to classify commands, shouldn't we be consistent in how we do so?

Show 20 quoted lines
> > Signed-off-by: John Keeping <john@keeping.me.uk>
> > ---
> >  contrib/completion/git-completion.bash | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/contrib/completion/git-completion.bash
> > b/contrib/completion/git-completion.bash
> > index 51f5223..250788a 100644
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -728,7 +728,6 @@ __git_list_porcelain_commands ()
> >  		write-tree)       : plumbing;;
> >  		var)              : infrequent;;
> >  		verify-pack)      : infrequent;;
> > -		verify-tag)       : plumbing;;
> >  		*) echo $i;;
> >  		esac
> >  	done
> > --
> > 2.7.0
Junio C Hamano· Feb 1, 2016, 18:51 UTC · re: John Keeping · lore

Re: [PATCH] completion: verify-tag is not plumbing

John Keeping <john@keeping.me.uk> writes:
> I can accept that argument about verify-commit and verify-tag, but
> listing verify-tag as plumbing is incorrect according to
> command-list.txt (and thus git(1)).  If we're going to classify
> commands, shouldn't we be consistent in how we do so?

These are not meant to be "classifications", but "justifications". When somebody asks "why isn't this command tab-completed?", you can find the explanation e.g. "because it is rarely used".

A command being 'plumbing' does not have to make it automatically ineligible from getting tab-completed. For some small tasks, running a plumbing command may be the easiest way to achieve them in the interactive session, and it helps to have tab-completion for such a plumbing command (e.g. "git apply" is completed, IIRC).

Also often the line between plumbing and Porcelain is somewhat blurry. I'd consider ancillaryX categories in command-list.txt a cop-out myself.

In this particular case, saying "better use 'tag --verify'" there instead of "plumbing" may be more helpful for those who are reading this script.

Show 20 quoted lines
>> > Signed-off-by: John Keeping <john@keeping.me.uk>
>> > ---
>> >  contrib/completion/git-completion.bash | 1 -
>> >  1 file changed, 1 deletion(-)
>> >
>> > diff --git a/contrib/completion/git-completion.bash
>> > b/contrib/completion/git-completion.bash
>> > index 51f5223..250788a 100644
>> > --- a/contrib/completion/git-completion.bash
>> > +++ b/contrib/completion/git-completion.bash
>> > @@ -728,7 +728,6 @@ __git_list_porcelain_commands ()
>> >  		write-tree)       : plumbing;;
>> >  		var)              : infrequent;;
>> >  		verify-pack)      : infrequent;;
>> > -		verify-tag)       : plumbing;;
>> >  		*) echo $i;;
>> >  		esac
>> >  	done
>> > --
>> > 2.7.0

← back to recent threads