fix gitk with lots of tags
PATCH 1/1 fix gitk with lots of tags
Hi Paul,
This fix allow gitk to be used on repositories with lots of tags. It bypasses git-rev-parse and passes its arguments to git-rev-list directly to avoid the command line length restrictions.
-Jim
---
gitk +4 -12
@@ -17,19 +17,11 @@ proc gitdir {} { } proc parse_args {rargs} { - global parsed_args - - if {[catch { - set parse_args [concat --default HEAD $rargs] - set parsed_args [split [eval exec git-rev-parse $parse_args] "\n"] - }]} { - # if git-rev-parse failed for some reason... - if {$rargs == {}} { - set rargs HEAD - } - set parsed_args $rargs + if {$rargs == {}} { + return HEAD + } else { + return $rargs } - return $parsed_args } proc start_rev_list {rlargs} {
PATCH RESEND 1/1 fix gitk with lots of tags
Hi Junio,
I've gotten no reposnse from Paul on this patch[1]. If it seems ok to you, would you mind putting it in your queue for him? I hate to see gitk die with "argument list too long" messages. They're so 640k.
Thanks,
-Jim
[1] Maybe he judges people by the color of their IP address? Then again, he could just be busy.
---
This fix allow gitk to be used on repositories with lots of tags. It bypasses git-rev-parse and passes its arguments to git-rev-list directly to avoid tcl's argument list length restrictions.
gitk +4 -12
@@ -17,19 +17,11 @@ proc gitdir {} { } proc parse_args {rargs} { - global parsed_args - - if {[catch { - set parse_args [concat --default HEAD $rargs] - set parsed_args [split [eval exec git-rev-parse $parse_args] "\n"] - }]} { - # if git-rev-parse failed for some reason... - if {$rargs == {}} { - set rargs HEAD - } - set parsed_args $rargs + if {$rargs == {}} { + return HEAD + } else { + return $rargs } - return $parsed_args } proc start_rev_list {rlargs} {
Quoted 4 lines · Jim Radford
I've gotten no reposnse from Paul on this patch[1]. If it seems ok to you, would you mind putting it in your queue for him? I hate to see gitk die with "argument list too long" messages. They're so 640k.
Don't do this patch. It's wrong.
However, this simpler patch might be ok.
It just depends on the fact that git-rev-list can parse everything that git-rev-parse used to do these days, and thus the git-rev-parse call really isn't needed any more (and if that isn't true for some odd argument, we should make it true).
So the only thing we need to do is to add the "--default HEAD" thing to the front of the argument list.
Linus
---
gitk +1 -10
@@ -19,16 +19,7 @@ proc gitdir {} { proc parse_args {rargs} { global parsed_args - if {[catch { - set parse_args [concat --default HEAD $rargs] - set parsed_args [split [eval exec git-rev-parse $parse_args] "\n"] - }]} { - # if git-rev-parse failed for some reason... - if {$rargs == {}} { - set rargs HEAD - } - set parsed_args $rargs - } + set parsed_args [concat --default HEAD $rargs] return $parsed_args }
Quoted 3 lines · Jim Radford
I've gotten no reposnse from Paul on this patch[1]. If it seems ok to you, would you mind putting it in your queue for him? I hate to see gitk die with "argument list too long" messages. They're so 640k.
The reservation I have about this is that I need to be able to tell the file/directory names from the tags/heads/SHA1 IDs. After the pass through git-rev-parse it's easy; I just take the things that match ^[a-f0-9]{40}$ as IDs and the rest as file/directory names or switches.
Junio, did you tell me some time ago about a flag to git-rev-parse that spits out just the file/directory names? What was it again?
Quoted 1 line
[1] Maybe he judges people by the color of their IP address?
As in _black_bean.org? :)
Quoted 1 line
Then again, he could just be busy.
Yeah. Or just returned from international travel, or something like that. :)
Paul.
Quoted 3 lines · Paul Mackerras
Junio, did you tell me some time ago about a flag to git-rev-parse that spits out just the file/directory names? What was it again?
git-rev-parse --no-flags --no-revs "$@"
should fo what you want.
Linus