@matheusbsbs / matheus-bagliano / commits / 61e56c8823
Fork 0

gitk: Let git-rev-list do the argument list parsing

This is a fix for a problem reported by Jim Radford where an argument list somewhere overflows on repositories with lots of tags. In fact it's now unnecessary to use git-rev-parse since git-rev-list can take all the arguments that git-rev-parse can. This is inspired by but not the same as the solutions suggested by Jim Radford and Linus Torvalds. Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras committed Apr 23, 2006 at 18:00 UTC 61e56c8823afd2c5a753a4969330ead0ba850c66
1 file changed +2 -18
gitk
+2 -18
@@ -16,22 +16,6 @@ proc gitdir {} {
16 }
17 }
18
19 -proc parse_args {rargs} {
20 - global parsed_args
21 -
22 - if {[catch {
23 - set parse_args [concat --default HEAD $rargs]
24 - set parsed_args [split [eval exec git-rev-parse $parse_args] "\n"]
25 - }]} {
26 - # if git-rev-parse failed for some reason...
27 - if {$rargs == {}} {
28 - set rargs HEAD
29 - }
30 - set parsed_args $rargs
31 - }
32 - return $parsed_args
33 -}
34 -
19 proc start_rev_list {rlargs} {
20 global startmsecs nextupdate ncmupdate
21 global commfd leftover tclencoding datemode
@@ -46,7 +30,7 @@ proc start_rev_list {rlargs} {
30 }
31 if {[catch {
32 set commfd [open [concat | git-rev-list --header $order \
49 - --parents --boundary $rlargs] r]
33 + --parents --boundary --default HEAD $rlargs] r]
34 } err]} {
35 puts stderr "Error executing git-rev-list: $err"
36 exit 1
@@ -65,7 +49,7 @@ proc getcommits {rargs} {
49 global phase canv mainfont
50
51 set phase getcommits
68 - start_rev_list [parse_args $rargs]
52 + start_rev_list $rargs
53 $canv delete all
54 $canv create text 3 3 -anchor nw -text "Reading commits..." \
55 -font $mainfont -tags textitems