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
Junio C Hamano <gitster@pobox.com>
Date
Jun 7, 2013, 18:41 UTC
Message-ID
<7v8v2lu5ks.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CALkWK0=D7sHLgptWkFHma1FoS-zdifHqXnuuBKhkyuszgEJ0Xw@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 15 quoted lines
> SZEDER Gábor wrote:
>> the one at the top because
>> of the reasons given in $gmane/226272
>
> Sorry about the delay: I went to sleep for a couple of days :P
>
>> the one at the bottom because
>> of the misleading commit message (__git_complete_file() always
>> completed refs first as part of the ref:file notation, so it worked
>> just fine except for the ref1...ref2 notation; the real reason for
>> calling __git_complete_revlist_file() for difftool is to make clear
>> that difftool takes ref1...ref2:file, too).
>
> How am I (or anyone else) supposed to know the "intended" meaning
> __git_complete_file()?
"git log -Gcomplete_file -p contrib/completion" found this one:
commit 1d66ec587e7d903afdf12a81718772a9eadc15a1
Author: SZEDER Gábor <szeder@ira.uka.de>
Date:   Thu Mar 10 19:12:29 2011 +0100
    bash: complete 'git diff ...branc<TAB>'
    
    While doing a final sanity check before merging a topic Bsomething, it
    is a good idea to review what damage Bsomething branch would make, by
    running:
    
        $ git diff ...Bsomething
    
    Unfortunately, our completion script for 'git diff' doesn't offer
    anything after '...'.  This is because 'git diff's completion function
    invokes __git_complete_file() for non-option arguments to complete the
    '<tree>:<path>' extended SHA-1 notation, but this helper function
    doesn't support refs after '...' or '..'.  Completion of refs after
    '...' or '..' is supported by the __git_complete_revlist() helper
    function, but that doesn't support '<tree>:<path>'.
    
    To support both '...<ref>' and '<tree>:<path>' notations for 'git
    diff', this patch, instead of adding yet another helper function,
    joins __git_complete_file() and __git_complete_revlist() into the new
    common function __git_complete_revlist_file().  The old helper
    functions __git_complete_file() and __git_complete_revlist() are
    changed to be a direct wrapper around the new
    __git_complete_revlist_file(), because they might be used in
    user-supplied completion scripts and we don't want to break them.
    
    This change will cause some wrong suggestions for other commands which
    use __git_complete_file() ('git diff' and friends) or
    __git_complete_revlist() ('git log' and friends), e.g. 'git diff
    ...master:Doc<TAB>' and 'git log master:Doc<TAB>' will complete the
    path to 'Documentation/', although neither commands make any sense.
    However, both of these were actively wrong to begin with as soon as
    the user entered the ':', so there is no real harm done.
    
    Suggested-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>

Now I do not recall suggesting it, and you (and I today after 2 years) may disagree with the rationale, but at least we can read what was the "intended" meaning, I think.

Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 9 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.