Re: [PATCH] Re: Gitk --all error when there are more than 797 refs in a repository
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:26
Pat Thoyts [off-list ref] writes:
quoted hunk
commit 7f289ca8370e5e2f9622a4fbc30b934eb97b984f Author: Pat Thoyts [off-list ref] 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 [off-list ref]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 }
That looks like an ugly hack (aka sweeping the issue under the rug). What if there are many tags and the user used --tags? Don't you have exactly the same problem? Likewise, what if $revs were "..master"? The right approach would be to understand what limit it is busting (it is not likely to be the command line length limit for this particular "exec", as it only gets "git" "rev-parse" "--all") first, and then fix that.
if {[catch {set ids [eval exec git rev-parse $revs]} err]} {
# we get stdout followed by stderr in $err