git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What's cooking in git.git (Jun 2013, #03; Thu, 6)

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Jun 8, 2013, 00:11 UTC
Message-ID
<20130608001147.GA32350@goldbirke>
In-Reply-To
<7vk3m5si4h.fsf@alter.siamese.dyndns.org>
On Fri, Jun 07, 2013 at 02:53:02PM -0700, Junio C Hamano wrote:
Show 25 quoted lines
> SZEDER Gábor <szeder@ira.uka.de> writes:
> 
> > On Fri, Jun 07, 2013 at 12:46:25PM -0700, Junio C Hamano wrote:
> >> Thanks for a pointer.  I think what I was suggesting was slightly
> >> different in that I was hoping to see a single helper that knows to
> >> complete to object names (possibly including trees/blobs with the
> >> treeish:path notation), ranges, and pathnames (not treeish:path
> >> notation) until it sees a "--" and then complete only to pathnames.
> >
> > We already got that except the completion of pathnames before "--",
> > and I don't know how that could be done properly for commands taking
> > both refs and paths.
> > ...
> >   git diff git.c
> >   git diff master git.c
> >   git diff master next git.c
> 
> It is somewhat annoying that "git diff gi<TAB>" stops at expanding
> it to "git diff git" and then upon another "git diff git<TAB>"
> offers tags whose names begin with "git" (e.g. gitgui-0.10.0) but
> the pathname git.c is not included in the choices.  My wish was to
> take the union in such a fairly limited case.  I tend to agree with
> you that "git diff <TAB>" that expands to all refs and pathnames
> would be useless, but so is expansion to all pathnames (or refnames
> for that matter).

... or trying to complete a branch name starting with a 'v', and then getting all the vx.y.z tags.

If you know you want git.c, then you can force filename completion either by entering "--" before hitting tab or by using the Alt-/ Bash (readline?) keybinding, otherwise you'll get refs. I think this is more than adequate, as it brings the best of both worlds: you can quickly and easily get both ref-only and file-only completion. Training your fingers to type "--" is perhaps better, just in case we'll ever do tracked-file-aware filename completion for e.g. 'git log -- g<TAB>' in the future.

Best, Gábor

Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 24 in “What's cooking in git.git (Jun 2013, #03; Thu, 6)”
  1. Junio C HamanoJun 6, 2013
  2. SZEDER GáborJun 7, 2013
  3. Junio C HamanoJun 7, 2013
  4. Junio C HamanoJun 7, 2013
  5. SZEDER GáborJun 7, 2013
  6. Ramkumar RamachandraJun 7, 2013
  7. SZEDER GáborJun 7, 2013
  8. Ramkumar RamachandraJun 7, 2013
  9. Junio C HamanoJun 7, 2013
  10. Ramkumar RamachandraJun 7, 2013
  11. SZEDER GáborJun 7, 2013
  12. Junio C HamanoJun 7, 2013
  13. SZEDER GáborJun 7, 2013
  14. Junio C HamanoJun 7, 2013
  15. SZEDER GáborJun 8, 2013
  16. Junio C HamanoJun 9, 2013
  17. SZEDER GáborJun 9, 2013
  18. Junio C HamanoJun 9, 2013
  19. Ramkumar RamachandraJun 10, 2013
  20. Junio C HamanoJun 10, 2013
  21. Ramkumar RamachandraJun 10, 2013
  22. SZEDER GáborJun 7, 2013
  23. Ramkumar RamachandraJun 8, 2013
  24. Matthieu MoyJun 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.