Hello Jonathan,
On Sun, May 19, 2013 at 10:33:21AM -0700, Jonathan Nieder wrote:
> Kreutzmann wrote:
> 
> > However, typing "git log de<TAB>" produces:
> > #git log debian/1.
> > and typing <TAB> twice produces:
> > debian/1.4.4-7+squeeze3   debian/1.5.3-2.11.1       debian/1.5.3-2.14 
> > debian/1.5.3-2.9          debian/1.6.1-2            debian/1.6.2-4 
> > debian/1.6.2-7
> > debian/1.5.3-2.10         debian/1.5.3-2.12         debian/1.5.3-2.15 
> > debian/1.5.3-5            debian/1.6.1-3            debian/1.6.2-5
> > debian/1.5.3-2.11         debian/1.5.3-2.13         debian/1.5.3-2.16 
> > debian/1.6.1-1            debian/1.6.2-1            debian/1.6.2-6
> 
> Sorry for the slow reply.  The syntax of the "git log" command is
> 
>       git log <revisions> [--] <paths>

This is not obvious from the man page. It (currently, stable) says:

git log [<options>] [<since>..<until>] [[--] <path>...]

However, the most important part for this argument (the separation
with "--") is of course (unfortunately) true.

> The bash completion script therefore assumes what you are typing
> as an argument to "git log" is a revision.  To complete on paths,

This is not 100% true. If no revision is found (I assume) than pathes
are directly taken, note my example with fr.po (works with other
languages as well). So it seems that I'm unlucky that both revisions
(debian) and paths (de.po) both start with "de".

> you can do
> 
>       git log -- de<TAB>

Well, this is not shorter than typeing

git log de.po

So the best is to type

git log de.<TAB>

But thanks 

> I'm not sure what the best way to make this more intuitive would be.
> Should the completion script get a manpage?  Should commands like this

No, don't write a man page for the completion script, I think this is
overblown (and how would you call it?). I think the best place to
document this is README.Debian (or the upstream README(s)).

> complete on revs intermixed with paths, with the confusion (git errors
> out for revisions after paths) and performance penalty that entails?

My personal preference would be to intermix them, but since I'm not a
havy git user please consult a wider audience before choosing a path
forward.

(And running into bash completion I'm willing to spend 10^(-x) seconds
longer for the comfort).

Thanks!

Greetings

          Helge

-- 
      Dr. Helge Kreutzmann                     [email protected]
           Dipl.-Phys.                   http://www.helgefjell.de/debian.php
        64bit GNU powered                     gpg signed mail preferred
           Help keep free software "libre": http://www.ffii.de/

Attachment: signature.asc
Description: Digital signature

Reply via email to