* [PATCH] completion: use __gitcomp_builtin for format-patch
@ 2018-10-21 8:41 Nguyễn Thái Ngọc Duy
2018-10-22 10:17 ` SZEDER Gábor
2018-10-22 12:12 ` Johannes Schindelin
0 siblings, 2 replies; 4+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2018-10-21 8:41 UTC (permalink / raw)
To: git; +Cc: Eric Sunshine, Nguyễn Thái Ngọc Duy
This helps format-patch gain completion for a couple new options,
notably --range-diff.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
Of course it will be even better if I could complete the ref for
--range-diff=, but maybe another day.
contrib/completion/git-completion.bash | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index c8fdcf8644..065b922777 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1533,12 +1533,8 @@ _git_fetch ()
}
__git_format_patch_options="
- --stdout --attach --no-attach --thread --thread= --no-thread
- --numbered --start-number --numbered-files --keep-subject --signoff
- --signature --no-signature --in-reply-to= --cc= --full-index --binary
- --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
- --inline --suffix= --ignore-if-in-upstream --subject-prefix=
- --output-directory --reroll-count --to= --quiet --notes
+ --full-index --not --all --no-prefix --src-prefix=
+ --dst-prefix= --notes
"
_git_format_patch ()
@@ -1551,7 +1547,7 @@ _git_format_patch ()
return
;;
--*)
- __gitcomp "$__git_format_patch_options"
+ __gitcomp_builtin format-patch "$__git_format_patch_options"
return
;;
esac
--
2.19.1.647.g708186aaf9
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] completion: use __gitcomp_builtin for format-patch
2018-10-21 8:41 [PATCH] completion: use __gitcomp_builtin for format-patch Nguyễn Thái Ngọc Duy
@ 2018-10-22 10:17 ` SZEDER Gábor
2018-10-22 14:25 ` Duy Nguyen
2018-10-22 12:12 ` Johannes Schindelin
1 sibling, 1 reply; 4+ messages in thread
From: SZEDER Gábor @ 2018-10-22 10:17 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: Junio C Hamano, git, Eric Sunshine
On Sun, Oct 21, 2018 at 10:41:02AM +0200, Nguyễn Thái Ngọc Duy wrote:
> This helps format-patch gain completion for a couple new options,
> notably --range-diff.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> Of course it will be even better if I could complete the ref for
> --range-diff=, but maybe another day.
>
> contrib/completion/git-completion.bash | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index c8fdcf8644..065b922777 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1533,12 +1533,8 @@ _git_fetch ()
> }
>
> __git_format_patch_options="
> - --stdout --attach --no-attach --thread --thread= --no-thread
> - --numbered --start-number --numbered-files --keep-subject --signoff
> - --signature --no-signature --in-reply-to= --cc= --full-index --binary
> - --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
> - --inline --suffix= --ignore-if-in-upstream --subject-prefix=
> - --output-directory --reroll-count --to= --quiet --notes
> + --full-index --not --all --no-prefix --src-prefix=
> + --dst-prefix= --notes
> "
$__git_format_patch_options is also used when completing 'git
send-email's options, thus removing all these options will badly
affect that, and in fact makes 't9902-completion.sh' fail with:
expecting success:
test_completion "git send-email --cov" "--cover-letter " &&
test_completion "git send-email ma" "master "
--- expected 2018-10-22 09:03:42.255325418 +0000
+++ out_sorted 2018-10-22 09:03:42.255325418 +0000
@@ -1 +1 @@
---cover-letter
+
not ok 122 - send-email
#
# test_completion "git send-email --cov" "--cover-letter " &&
# test_completion "git send-email ma" "master "
#
> _git_format_patch ()
> @@ -1551,7 +1547,7 @@ _git_format_patch ()
> return
> ;;
> --*)
> - __gitcomp "$__git_format_patch_options"
> + __gitcomp_builtin format-patch "$__git_format_patch_options"
You sent out a separate bugfix patch (i.e. not a patch series)
"completion: fix __gitcomp_builtin no longer consider extra options"
in:
https://public-inbox.org/git/20181021083731.8009-1-pclouds@gmail.com/
and this patch makes the completion of 'git format-patch' also use
extra options... So, does this patch really work without that bugfix?
> return
> ;;
> esac
> --
> 2.19.1.647.g708186aaf9
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] completion: use __gitcomp_builtin for format-patch
2018-10-21 8:41 [PATCH] completion: use __gitcomp_builtin for format-patch Nguyễn Thái Ngọc Duy
2018-10-22 10:17 ` SZEDER Gábor
@ 2018-10-22 12:12 ` Johannes Schindelin
1 sibling, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2018-10-22 12:12 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, Eric Sunshine
[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]
Hi Duy,
On Sun, 21 Oct 2018, Nguyễn Thái Ngọc Duy wrote:
> This helps format-patch gain completion for a couple new options,
> notably --range-diff.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> Of course it will be even better if I could complete the ref for
> --range-diff=, but maybe another day.
>
> contrib/completion/git-completion.bash | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index c8fdcf8644..065b922777 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1533,12 +1533,8 @@ _git_fetch ()
> }
>
> __git_format_patch_options="
> - --stdout --attach --no-attach --thread --thread= --no-thread
> - --numbered --start-number --numbered-files --keep-subject --signoff
> - --signature --no-signature --in-reply-to= --cc= --full-index --binary
> - --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
> - --inline --suffix= --ignore-if-in-upstream --subject-prefix=
> - --output-directory --reroll-count --to= --quiet --notes
> + --full-index --not --all --no-prefix --src-prefix=
> + --dst-prefix= --notes
> "
>
> _git_format_patch ()
> @@ -1551,7 +1547,7 @@ _git_format_patch ()
> return
> ;;
> --*)
> - __gitcomp "$__git_format_patch_options"
> + __gitcomp_builtin format-patch "$__git_format_patch_options"
Is it just me, or does this fail t9902 for you, too, where it wants to
complete the --cover-letter option for *send-email* (not for
*format-patch*)?
See e.g.
https://git-for-windows.visualstudio.com/git/_build/results?buildId=22023&view=logs
Ciao,
Dscho
> return
> ;;
> esac
> --
> 2.19.1.647.g708186aaf9
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] completion: use __gitcomp_builtin for format-patch
2018-10-22 10:17 ` SZEDER Gábor
@ 2018-10-22 14:25 ` Duy Nguyen
0 siblings, 0 replies; 4+ messages in thread
From: Duy Nguyen @ 2018-10-22 14:25 UTC (permalink / raw)
To: SZEDER Gábor; +Cc: Junio C Hamano, Git Mailing List, Eric Sunshine
On Mon, Oct 22, 2018 at 12:17 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:
>
> On Sun, Oct 21, 2018 at 10:41:02AM +0200, Nguyễn Thái Ngọc Duy wrote:
> > This helps format-patch gain completion for a couple new options,
> > notably --range-diff.
> >
> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> > ---
> > Of course it will be even better if I could complete the ref for
> > --range-diff=, but maybe another day.
> >
> > contrib/completion/git-completion.bash | 10 +++-------
> > 1 file changed, 3 insertions(+), 7 deletions(-)
> >
> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> > index c8fdcf8644..065b922777 100644
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -1533,12 +1533,8 @@ _git_fetch ()
> > }
> >
> > __git_format_patch_options="
> > - --stdout --attach --no-attach --thread --thread= --no-thread
> > - --numbered --start-number --numbered-files --keep-subject --signoff
> > - --signature --no-signature --in-reply-to= --cc= --full-index --binary
> > - --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
> > - --inline --suffix= --ignore-if-in-upstream --subject-prefix=
> > - --output-directory --reroll-count --to= --quiet --notes
> > + --full-index --not --all --no-prefix --src-prefix=
> > + --dst-prefix= --notes
> > "
>
> $__git_format_patch_options is also used when completing 'git
> send-email's options, thus removing all these options will badly
> affect that, and in fact makes 't9902-completion.sh' fail with:
Oops. I guess I was excited about the other fix and forgot to test
this patch. Junio please kick it out of 'pu'.
I'll need to think if I could somehow make send-email work without
hardcoding a bunch of options in it.,,
--
Duy
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-22 14:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-21 8:41 [PATCH] completion: use __gitcomp_builtin for format-patch Nguyễn Thái Ngọc Duy
2018-10-22 10:17 ` SZEDER Gábor
2018-10-22 14:25 ` Duy Nguyen
2018-10-22 12:12 ` Johannes Schindelin
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).