Thread (10 messages) flat view 10 messages, 3 authors, 2019-06-16

Re: [PATCH] completion: do not cache if --git-completion-helper fails

From: Felipe Contreras <hidden>
Date: 2019-06-14 06:07:01

On Thu, Jun 13, 2019 at 9:53 PM Duy Nguyen [off-list ref] wrote:
On Fri, Jun 14, 2019 at 7:30 AM Felipe Contreras
[off-list ref] wrote:
quoted
One way or the other, shouldn't my tests be merged? The issue is still
there, and it's nice to have tests for that.
Is there any good reason to complete options when they are not going
to work anyway (e.g. like checkout which needs $GIT_DIR)? Besides "it
used to work before --git-completion-helper" which I don't consider a
good reason given the maintenance tradeoff of --git-completion-helper.
No, there is no good reason that I can think of, except checking the
arguments, which is precisely how I found out the issue; not something
I usually do. But a newcomer might not know what commands don't work
outside a git directory.

But more importantly; is there a good enough reason not to? I seem to
recall to be annoyed by the fact that 'git command -h' failed on some
command with a fatal error. Similarly, I don't see any good reason why
'git help clone' should ever fail.

These are not dealbreakers by any means, just some kind of weird
corner cases. Such things never happen in in Mercurial BTW.

And of course --git-completion-helper is the way to go, I recall I
wanted to implement such a thing myself, this has the potential to
increase the power of the zsh completion incredibly, although not yet.

But that doesn't mean it's perfect and there are no regressions; there
are. I just think they should be documented in the testing framework.
They are not big enough to warrant going back from
--git-completion-helper though.

The only real issue I think has not been raised is that the completion
scripts are in "contrib", they are not considered part of the main
deliverables. So it's conceivable that somebody running Git v1.6 tries
the completion scripts of v1.20, and everything breaks. I'm still not
exactly sure what should be the way to solve this conundrum, but
again, I don't think going back from --git-completion-helper is a good
move. I don't think I suggested that.

Cheers.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help