* [PATCH] _git: add completion for git-version
@ 2020-01-19 21:31 Eitan Adler
2020-01-19 22:13 ` Daniel Shahaf
0 siblings, 1 reply; 5+ messages in thread
From: Eitan Adler @ 2020-01-19 21:31 UTC (permalink / raw)
To: zsh-workers; +Cc: Eitan Adler
Signed-off-by: Eitan Adler <lists@eitanadler.com>
---
Completion/Unix/Command/_git | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 7f2c206c1..ba1852699 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -407,6 +407,12 @@ _git-bundle () {
return ret
}
+(( $+functions[_git-version] )) ||
+_git-version () {
+ _arguments -S $endopt \
+ '--build-options[also print build options]'
+}
+
(( $+functions[_git-check-ignore] )) ||
_git-check-ignore () {
_arguments -s -S $endopt \
@@ -5951,7 +5957,8 @@ _git_commands () {
show-branch:'show branches and their commits'
verify-commit:'check GPG signature of commits'
verify-tag:'check GPG signature of tags'
- whatchanged:'show commit-logs and differences they introduce')
+ whatchanged:'show commit-logs and differences they introduce'
+ version:'show git version')
interaction_commands=(
archimport:'import an Arch repository into git'
--
2.25.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] _git: add completion for git-version
2020-01-19 21:31 [PATCH] _git: add completion for git-version Eitan Adler
@ 2020-01-19 22:13 ` Daniel Shahaf
2020-01-19 23:09 ` Oliver Kiddle
2020-01-20 2:00 ` Eitan Adler
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Shahaf @ 2020-01-19 22:13 UTC (permalink / raw)
To: Eitan Adler, zsh-workers
Eitan Adler wrote on Sun, 19 Jan 2020 21:31 +00:00:
> +++ b/Completion/Unix/Command/_git
> @@ -407,6 +407,12 @@ _git-bundle () {
> +_git-version () {
> + _arguments -S $endopt \
> + '--build-options[also print build options]'
> +}
> @@ -5951,7 +5957,8 @@ _git_commands () {
> + version:'show git version')
This subcommand is undocumented (except one mention in the release
notes); is it a public API?
«git --version --build-options» also works, but doesn't seem to be
documented, either.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] _git: add completion for git-version
2020-01-19 22:13 ` Daniel Shahaf
@ 2020-01-19 23:09 ` Oliver Kiddle
2020-01-19 23:31 ` Daniel Shahaf
2020-01-20 2:00 ` Eitan Adler
1 sibling, 1 reply; 5+ messages in thread
From: Oliver Kiddle @ 2020-01-19 23:09 UTC (permalink / raw)
To: Daniel Shahaf; +Cc: Eitan Adler, zsh-workers
Daniel Shahaf wrote:
> This subcommand is undocumented (except one mention in the release
> notes); is it a public API?
Features being undocumented hasn't necessarily stopped us from
including them in completion in the past. I don't think there's any
established policy on this and it can depend on specific cases. In
some cases you would want completion to understand but not offer
the undocumented match (like ! in _arguments specs). This particular
patch seems reasonable to me as-is.
> «git --version --build-options» also works, but doesn't seem to be
> documented, either.
The output of git --version -h or git version -h mentions it. I'd say
that counts even if the man page omits to mention it.
Oliver
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] _git: add completion for git-version
2020-01-19 22:13 ` Daniel Shahaf
2020-01-19 23:09 ` Oliver Kiddle
@ 2020-01-20 2:00 ` Eitan Adler
1 sibling, 0 replies; 5+ messages in thread
From: Eitan Adler @ 2020-01-20 2:00 UTC (permalink / raw)
To: Daniel Shahaf; +Cc: Zsh hackers list
On Sun, 19 Jan 2020 at 14:14, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> Eitan Adler wrote on Sun, 19 Jan 2020 21:31 +00:00:
> > +++ b/Completion/Unix/Command/_git
> > @@ -407,6 +407,12 @@ _git-bundle () {
> > +_git-version () {
> > + _arguments -S $endopt \
> > + '--build-options[also print build options]'
> > +}
> > @@ -5951,7 +5957,8 @@ _git_commands () {
> > + version:'show git version')
>
> This subcommand is undocumented (except one mention in the release
> notes); is it a public API?
I believe it to be a public API. In fact the --build-options was added
since modifying the output otherwise would affect consumers. I'll add
sending an upstream patch to git to my never ending TODO list.
--
Eitan Adler
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-01-20 2:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-19 21:31 [PATCH] _git: add completion for git-version Eitan Adler
2020-01-19 22:13 ` Daniel Shahaf
2020-01-19 23:09 ` Oliver Kiddle
2020-01-19 23:31 ` Daniel Shahaf
2020-01-20 2:00 ` Eitan Adler
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).