git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-completion.bash should not add a space after a ref
@ 2013-01-12 18:35 Manlio Perillo
  2013-01-13 23:16 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Manlio Perillo @ 2013-01-12 18:35 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: SZEDER Gábor, Felipe Contreras

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

This is not really a bug, but a small usability problem.

When completing a reference, Bash will add a space after the reference name.

As an example in:

    $git show master<TAB>

The problem is that an user may want to show a tree or blog object from
master:

    $git show master:git.c


A possible solution is to define a new __gitcomp_nospace function and
use it where appropriate.

Probably the __gitcomp_nospace should be used when git_complete_file is
called, and __gitcomp_nl should be used when __git_complete_revlist  is
called, but I'm not sure.

P.S.:
it seems that __gitcomp_nl is **never** called with 4 arguments.



Regards  Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlDxrQ8ACgkQscQJ24LbaURHmACfRXoM+uEVDgFUtZFzUcPC5oSZ
FGsAnAxQf+SN7GrNljxU1io4IuayHmed
=JRVU
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git-completion.bash should not add a space after a ref
  2013-01-12 18:35 git-completion.bash should not add a space after a ref Manlio Perillo
@ 2013-01-13 23:16 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2013-01-13 23:16 UTC (permalink / raw)
  To: Manlio Perillo; +Cc: git@vger.kernel.org, SZEDER Gábor, Felipe Contreras

Manlio Perillo <manlio.perillo@gmail.com> writes:

> This is not really a bug, but a small usability problem.
>
> When completing a reference, Bash will add a space after the reference name.
>
> As an example in:
>
>     $git show master<TAB>
>
> The problem is that an user may want to show a tree or blog object from
> master:
>
>     $git show master:git.c

Or the user may want to see only changes to the documentation, e.g.

	$ git show master Documentation/

so removing a SP is a regression in the other way around.

Given that "refer to an object in a tree" is a much less often used
operation, I have a feeling that the current behaviour happens to
make a good trade-off between these two conflicting purposes that
cannot be satisfied both at the same time.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-13 23:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-12 18:35 git-completion.bash should not add a space after a ref Manlio Perillo
2013-01-13 23:16 ` 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).