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

Re: [PATCH] Re: Gitk --all error when there are more than 797 refs in a repository

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Sep 18, 2009, 15:16 UTC
Message-ID
<4AB3A458.5070100@viscovery.net>
In-Reply-To
<878wgcbb52.fsf@users.sourceforge.net>
Pat Thoyts schrieb:
Show 17 quoted lines
> "Murphy, John" <john.murphy@bankofamerica.com> writes:
>> There is a error when running  gitk --all when there are more than 797 refs in a repository.
>> We get an error message:
>>
>> Error reading commits: fatal ambiguous argument '3': unknown revision or path not in the working tree.
>> Use '--' to separate paths from revisions.
>>
>> I believe issue is with this line of the code in proc parseviewrevs:
>>
>>       if {[catch {set ids [eval exec git rev-parse "$revs"]} err]}
>>
>> When there are more than 797 refs the output of git rev-parse is too large to fit into the string, ids.
>>
>> 797 refs = 32,677 bytes.
>> 798 refs = 32,718 bytes my guess is a little too close for comfort to 32,768 bytes.
>>
>> As I was deleting refs locally the error message would change from '3' to any char [A-Z,0-9].

I cannot reproduce the error. I have a repository with 100 commits in a linear history and 5000 refs (50 refs per commit). They are named refs/heads/branch-XXXX. I don't see any problems with 'gitk --all'.

Show 18 quoted lines
> +proc git-rev-parse {args} {
> +    set ids {}
> +    set pipe [open |[linsert $args 0 git rev-parse] r]
> +    while {[gets $pipe line] != -1} {
> +        lappend ids $line
> +    }
> +    close $pipe
> +    return $ids
> +}
> +    
>  proc parseviewrevs {view revs} {
>      global vposids vnegids
>  
>      if {$revs eq {}} {
>  	set revs HEAD
>      }
> -    if {[catch {set ids [eval exec git rev-parse $revs]} err]} {
> +    if {[catch {set ids [git-rev-parse $revs]} err]} {

Sorry, but you are changing the wrong end of git rev-parse. The limit is on the command line, but if you run 'gitk --all', then $revs is simply "--all" - no limit is exceeded. You changed the output of rev-parse, but there is no limit on how much Tcl can eat of rev-parse's output.

The error must be in some other git invocation.
-- Hannes
Previous: Pat ThoytsNext: Paul Mackerras
Message 3 of 19 in “Gitk --all error when there are more than 797 refs in a repository”
  1. Murphy, JohnSep 17, 2009
  2. Re: Gitk --all error when there are more than 797 refs in a repositoryPat Thoyts, Sep 18, 2009
  3. Johannes SixtSep 18, 2009
  4. Re: Gitk --all error when there are more than 797 refs in a repositoryPaul Mackerras, Sep 19, 2009
  5. Murphy, JohnSep 21, 2009
  6. Johannes SixtSep 21, 2009
  7. Murphy, JohnSep 21, 2009
  8. Johannes SixtSep 21, 2009
  9. Pat ThoytsSep 21, 2009
  10. Murphy, JohnSep 22, 2009
  11. Junio C HamanoSep 22, 2009
  12. Junio C HamanoSep 22, 2009
  13. Pat ThoytsSep 22, 2009
  14. Alex RiesenNov 3, 2009
  15. Paul MackerrasNov 3, 2009
  16. Paul MackerrasSep 22, 2009
  17. Junio C HamanoSep 23, 2009
  18. Paul MackerrasNov 3, 2009
  19. Junio C HamanoNov 3, 2009

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.