Skip to content

Commit 29ac66b

Browse files
committed
Merge 'gitk' into HEAD
2 parents 33502d0 + 18b73ac commit 29ac66b

File tree

1 file changed

+44
-25
lines changed

1 file changed

+44
-25
lines changed

gitk-git/gitk

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ proc start_rev_list {view} {
406406
if {$revs eq {}} {
407407
return 0
408408
}
409-
set args [concat $vflags($view) $revs]
409+
set args [limit_arg_length [concat $vflags($view) $revs]]
410410
} else {
411411
set args $vorigargs($view)
412412
}
@@ -10040,7 +10040,8 @@ proc getallcommits {} {
1004010040
}
1004110041
}
1004210042
if {$ids ne {}} {
10043-
set fd [open [concat $cmd $ids] r]
10043+
set cmd [limit_arg_length [concat $cmd $ids]]
10044+
set fd [open $cmd r]
1004410045
fconfigure $fd -blocking 0
1004510046
incr allcommits
1004610047
nowbusy allcommits
@@ -10050,6 +10051,21 @@ proc getallcommits {} {
1005010051
}
1005110052
}
1005210053

10054+
# The maximum command line length for the CreateProcess function is 32767 characters, see
10055+
# http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
10056+
# Be a little conservative in case Tcl adds some more stuff to the command line we do not
10057+
# know about and truncate the command line at a SHA1-boundary below 32000 characters.
10058+
proc limit_arg_length {cmd} {
10059+
if {[tk windowingsystem] == "win32" &&
10060+
[string length $cmd] > 32000} {
10061+
set ndx [string last " " $cmd 32000]
10062+
if {$ndx != -1} {
10063+
return [string range $cmd 0 $ndx]
10064+
}
10065+
}
10066+
return $cmd
10067+
}
10068+
1005310069
# Since most commits have 1 parent and 1 child, we group strings of
1005410070
# such commits into "arcs" joining branch/merge points (BMPs), which
1005510071
# are commits that either don't have 1 parent or don't have 1 child.
@@ -12060,7 +12076,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1206012076
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1206112077
set gitk_libdir [file join $gitk_prefix share gitk lib]
1206212078
set gitk_msgsdir [file join $gitk_libdir msgs]
12063-
unset gitk_prefix
1206412079
}
1206512080

1206612081
## Internationalization (i18n) through msgcat and gettext. See
@@ -12411,28 +12426,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1241112426
set worktree [exec git rev-parse --show-toplevel]
1241212427
setcoords
1241312428
makewindow
12414-
catch {
12415-
image create photo gitlogo -width 16 -height 16
12416-
12417-
image create photo gitlogominus -width 4 -height 2
12418-
gitlogominus put #C00000 -to 0 0 4 2
12419-
gitlogo copy gitlogominus -to 1 5
12420-
gitlogo copy gitlogominus -to 6 5
12421-
gitlogo copy gitlogominus -to 11 5
12422-
image delete gitlogominus
12423-
12424-
image create photo gitlogoplus -width 4 -height 4
12425-
gitlogoplus put #008000 -to 1 0 3 4
12426-
gitlogoplus put #008000 -to 0 1 4 3
12427-
gitlogo copy gitlogoplus -to 1 9
12428-
gitlogo copy gitlogoplus -to 6 9
12429-
gitlogo copy gitlogoplus -to 11 9
12430-
image delete gitlogoplus
12431-
12432-
image create photo gitlogo32 -width 32 -height 32
12433-
gitlogo32 copy gitlogo -zoom 2 2
12434-
12435-
wm iconphoto . -default gitlogo gitlogo32
12429+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12430+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12431+
} else {
12432+
catch {
12433+
image create photo gitlogo -width 16 -height 16
12434+
12435+
image create photo gitlogominus -width 4 -height 2
12436+
gitlogominus put #C00000 -to 0 0 4 2
12437+
gitlogo copy gitlogominus -to 1 5
12438+
gitlogo copy gitlogominus -to 6 5
12439+
gitlogo copy gitlogominus -to 11 5
12440+
image delete gitlogominus
12441+
12442+
image create photo gitlogoplus -width 4 -height 4
12443+
gitlogoplus put #008000 -to 1 0 3 4
12444+
gitlogoplus put #008000 -to 0 1 4 3
12445+
gitlogo copy gitlogoplus -to 1 9
12446+
gitlogo copy gitlogoplus -to 6 9
12447+
gitlogo copy gitlogoplus -to 11 9
12448+
image delete gitlogoplus
12449+
12450+
image create photo gitlogo32 -width 32 -height 32
12451+
gitlogo32 copy gitlogo -zoom 2 2
12452+
12453+
wm iconphoto . -default gitlogo gitlogo32
12454+
}
1243612455
}
1243712456
# wait for the window to become visible
1243812457
tkwait visibility .

0 commit comments

Comments
 (0)