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
Pat Thoyts <patthoyts@users.sourceforge.net>
Date
Sep 21, 2009, 23:56 UTC
Message-ID
<874oqvc0n3.fsf@users.sourceforge.net>
In-Reply-To
<4AB7A2E7.5000601@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
>Murphy, John schrieb:
>
>On Windows, 'gitk --all' starts with branch-0797, on Linux it starts with
>branch-0999 aka master.

That script gives me a repository I can test against. thanks. The start_rev_list function calls parseviewrevs and expands the arguments into a list of appropriate revision ids. In this case --all gets expanded to a list of 1000 sha1 ids. This is appended to any other view arguments and passed to git log on the command line yielding our error. git log can accept a --all argument it seems so it looks like we can just short-circuit the parseviewrevs function when --all is passed in and return --all instead of expanding the list. The following seems to work for me with this test repository. John, if this works for you can you also check that editing and creating new gitk views on your real repository continues to work ok.

commit 7f289ca8370e5e2f9622a4fbc30b934eb97b984f
Author: Pat Thoyts <patthoyts@users.sourceforge.net>
Date:   Tue Sep 22 00:55:50 2009 +0100
    Avoid expanding --all when passing arguments to git log.
    There is no need to expand --all into a list of all revisions as
    git log can accept --all as an argument. This avoids any
    command-line
    length limitations caused by expanding --all into a list of all
    revision ids.
    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
diff --git a/gitk b/gitk
index a0214b7..635b97e 100755
--- a/gitk
+++ b/gitk
@@ -241,6 +241,8 @@ proc parseviewrevs {view revs} {

     if {$revs eq {}} {
        set revs HEAD
+    } elseif {$revs eq "--all"} {
+        return $revs
     }
     if {[catch {set ids [eval exec git rev-parse $revs]} err]} {
        # we get stdout followed by stderr in $err
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
Previous: Johannes SixtNext: Murphy, John
Message 9 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.