* [PATCH] completion: simplify __git_complete_revlist_file
@ 2012-05-01 18:42 Felipe Contreras
2012-05-01 23:39 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Felipe Contreras @ 2012-05-01 18:42 UTC (permalink / raw)
To: git; +Cc: SZEDER Gábor, Felipe Contreras
Use new __gitcomp_nl; this is the last place that uses COMPREPLY and
compgen directly.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
contrib/completion/git-completion.bash | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 31f714d..d877a23 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -676,9 +676,7 @@ __git_complete_revlist_file ()
*) pfx="$ref:$pfx" ;;
esac
- local IFS=$'\n'
- COMPREPLY=($(compgen -P "$pfx" \
- -W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
+ __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
| sed '/^100... blob /{
s,^.* ,,
s,$, ,
@@ -692,7 +690,7 @@ __git_complete_revlist_file ()
s,$,/,
}
s/^.* //')" \
- -- "$cur_"))
+ "$pfx" "$cur_" ""
;;
*...*)
pfx="${cur_%...*}..."
--
1.7.10
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] completion: simplify __git_complete_revlist_file
2012-05-01 18:42 [PATCH] completion: simplify __git_complete_revlist_file Felipe Contreras
@ 2012-05-01 23:39 ` Junio C Hamano
2012-05-01 23:46 ` Felipe Contreras
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2012-05-01 23:39 UTC (permalink / raw)
To: Felipe Contreras; +Cc: SZEDER Gábor, git
Felipe Contreras <felipe.contreras@gmail.com> writes:
> Use new __gitcomp_nl; this is the last place that uses COMPREPLY and
> compgen directly.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> contrib/completion/git-completion.bash | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 31f714d..d877a23 100755
This seems to be based on 'maint', which has 31f714d, but I see two hits
with "git grep 'COMPREPLY.*compgen' contrib/completion" there, so I am not
sure if that is where you wanted it to apply.
I see this was not addressed to me (neither was the other zsh one), so I
take it that the patch is still for discussion, at least for the purpose
of today's integration round. Ping me when it is ready for either 'pu' or
'next'.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] completion: simplify __git_complete_revlist_file
2012-05-01 23:39 ` Junio C Hamano
@ 2012-05-01 23:46 ` Felipe Contreras
2012-05-05 15:19 ` Felipe Contreras
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Felipe Contreras @ 2012-05-01 23:46 UTC (permalink / raw)
To: Junio C Hamano; +Cc: SZEDER Gábor, git
On Wed, May 2, 2012 at 1:39 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> Use new __gitcomp_nl; this is the last place that uses COMPREPLY and
>> compgen directly.
>>
>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>> ---
>> contrib/completion/git-completion.bash | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
>> index 31f714d..d877a23 100755
>
> This seems to be based on 'maint', which has 31f714d, but I see two hits
> with "git grep 'COMPREPLY.*compgen' contrib/completion" there, so I am not
> sure if that is where you wanted it to apply.
The last place that is not the __gitcomp* functions, of course.
> I see this was not addressed to me (neither was the other zsh one), so I
> take it that the patch is still for discussion, at least for the purpose
> of today's integration round. Ping me when it is ready for either 'pu' or
> 'next'.
I'd say at least one person should say LGTM before asking you to integrate it.
Cheers.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] completion: simplify __git_complete_revlist_file
2012-05-01 23:46 ` Felipe Contreras
@ 2012-05-05 15:19 ` Felipe Contreras
2012-05-05 22:40 ` SZEDER Gábor
2012-05-07 17:15 ` Junio C Hamano
2 siblings, 0 replies; 6+ messages in thread
From: Felipe Contreras @ 2012-05-05 15:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: SZEDER Gábor, git
On Wed, May 2, 2012 at 1:46 AM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> On Wed, May 2, 2012 at 1:39 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> I see this was not addressed to me (neither was the other zsh one), so I
>> take it that the patch is still for discussion, at least for the purpose
>> of today's integration round. Ping me when it is ready for either 'pu' or
>> 'next'.
>
> I'd say at least one person should say LGTM before asking you to integrate it.
Nobody has raised any issues with this, so, please merge it to 'pu'.
This is so straight-forward that it might make sense to move to 'next'
through.
Cheers.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] completion: simplify __git_complete_revlist_file
2012-05-01 23:46 ` Felipe Contreras
2012-05-05 15:19 ` Felipe Contreras
@ 2012-05-05 22:40 ` SZEDER Gábor
2012-05-07 17:15 ` Junio C Hamano
2 siblings, 0 replies; 6+ messages in thread
From: SZEDER Gábor @ 2012-05-05 22:40 UTC (permalink / raw)
To: Felipe Contreras; +Cc: Junio C Hamano, git
Hi,
On Wed, May 02, 2012 at 01:46:32AM +0200, Felipe Contreras wrote:
> On Wed, May 2, 2012 at 1:39 AM, Junio C Hamano <gitster@pobox.com> wrote:
> > Felipe Contreras <felipe.contreras@gmail.com> writes:
> >
> >> Use new __gitcomp_nl; this is the last place that uses COMPREPLY and
> >> compgen directly.
I didn't dare to touch that code back then while doing the
__gitcomp_nl() changes; that sed command looked way too scary ;) But
all it does is to process the output of 'git ls-tree' and removes the
cruft and appends a space to filenames and a '/' to directories
(without a trailing space). So invoking __gitcomp_nl() with an empty
suffix parameter is OK, as it doesn't change the current behavior.
> >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> >> ---
> >> contrib/completion/git-completion.bash | 6 ++----
> >> 1 file changed, 2 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> >> index 31f714d..d877a23 100755
> >
> > This seems to be based on 'maint', which has 31f714d, but I see two hits
> > with "git grep 'COMPREPLY.*compgen' contrib/completion" there, so I am not
> > sure if that is where you wanted it to apply.
>
> The last place that is not the __gitcomp* functions, of course.
>
> > I see this was not addressed to me (neither was the other zsh one), so I
> > take it that the patch is still for discussion, at least for the purpose
> > of today's integration round. Ping me when it is ready for either 'pu' or
> > 'next'.
>
> I'd say at least one person should say LGTM before asking you to integrate it.
Yeah, it's good to go.
Best,
Gábor
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] completion: simplify __git_complete_revlist_file
2012-05-01 23:46 ` Felipe Contreras
2012-05-05 15:19 ` Felipe Contreras
2012-05-05 22:40 ` SZEDER Gábor
@ 2012-05-07 17:15 ` Junio C Hamano
2 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2012-05-07 17:15 UTC (permalink / raw)
To: Felipe Contreras; +Cc: Junio C Hamano, SZEDER Gábor, git
Felipe Contreras <felipe.contreras@gmail.com> writes:
> On Wed, May 2, 2012 at 1:39 AM, Junio C Hamano <gitster@pobox.com> wrote:
> ...
>> This seems to be based on 'maint', which has 31f714d, but I see two hits
>> with "git grep 'COMPREPLY.*compgen' contrib/completion" there, so I am not
>> sure if that is where you wanted it to apply.
>
> The last place that is not the __gitcomp* functions, of course.
OK, that is what you meant by "uses ... _directly_". With SG's Ack, will
queue.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-05-07 17:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-01 18:42 [PATCH] completion: simplify __git_complete_revlist_file Felipe Contreras
2012-05-01 23:39 ` Junio C Hamano
2012-05-01 23:46 ` Felipe Contreras
2012-05-05 15:19 ` Felipe Contreras
2012-05-05 22:40 ` SZEDER Gábor
2012-05-07 17:15 ` Junio C Hamano
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).