Skip to content

Commit 158d024

Browse files
committed
Merge 'gitk' into HEAD
2 parents bd81a43 + 3ecb14b commit 158d024

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
}
@@ -9911,7 +9911,8 @@ proc getallcommits {} {
99119911
}
99129912
}
99139913
if {$ids ne {}} {
9914-
set fd [open [concat $cmd $ids] r]
9914+
set cmd [limit_arg_length [concat $cmd $ids]]
9915+
set fd [open $cmd r]
99159916
fconfigure $fd -blocking 0
99169917
incr allcommits
99179918
nowbusy allcommits
@@ -9921,6 +9922,21 @@ proc getallcommits {} {
99219922
}
99229923
}
99239924

9925+
# The maximum command line length for the CreateProcess function is 32767 characters, see
9926+
# http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9927+
# Be a little conservative in case Tcl adds some more stuff to the command line we do not
9928+
# know about and truncate the command line at a SHA1-boundary below 32000 characters.
9929+
proc limit_arg_length {cmd} {
9930+
if {[tk windowingsystem] == "win32" &&
9931+
[string length $cmd] > 32000} {
9932+
set ndx [string last " " $cmd 32000]
9933+
if {$ndx != -1} {
9934+
return [string range $cmd 0 $ndx]
9935+
}
9936+
}
9937+
return $cmd
9938+
}
9939+
99249940
# Since most commits have 1 parent and 1 child, we group strings of
99259941
# such commits into "arcs" joining branch/merge points (BMPs), which
99269942
# are commits that either don't have 1 parent or don't have 1 child.
@@ -12077,7 +12093,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1207712093
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1207812094
set gitk_libdir [file join $gitk_prefix share gitk lib]
1207912095
set gitk_msgsdir [file join $gitk_libdir msgs]
12080-
unset gitk_prefix
1208112096
}
1208212097

1208312098
## Internationalization (i18n) through msgcat and gettext. See
@@ -12269,28 +12284,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1226912284
set worktree [exec git rev-parse --show-toplevel]
1227012285
setcoords
1227112286
makewindow
12272-
catch {
12273-
image create photo gitlogo -width 16 -height 16
12274-
12275-
image create photo gitlogominus -width 4 -height 2
12276-
gitlogominus put #C00000 -to 0 0 4 2
12277-
gitlogo copy gitlogominus -to 1 5
12278-
gitlogo copy gitlogominus -to 6 5
12279-
gitlogo copy gitlogominus -to 11 5
12280-
image delete gitlogominus
12281-
12282-
image create photo gitlogoplus -width 4 -height 4
12283-
gitlogoplus put #008000 -to 1 0 3 4
12284-
gitlogoplus put #008000 -to 0 1 4 3
12285-
gitlogo copy gitlogoplus -to 1 9
12286-
gitlogo copy gitlogoplus -to 6 9
12287-
gitlogo copy gitlogoplus -to 11 9
12288-
image delete gitlogoplus
12289-
12290-
image create photo gitlogo32 -width 32 -height 32
12291-
gitlogo32 copy gitlogo -zoom 2 2
12292-
12293-
wm iconphoto . -default gitlogo gitlogo32
12287+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12288+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12289+
} else {
12290+
catch {
12291+
image create photo gitlogo -width 16 -height 16
12292+
12293+
image create photo gitlogominus -width 4 -height 2
12294+
gitlogominus put #C00000 -to 0 0 4 2
12295+
gitlogo copy gitlogominus -to 1 5
12296+
gitlogo copy gitlogominus -to 6 5
12297+
gitlogo copy gitlogominus -to 11 5
12298+
image delete gitlogominus
12299+
12300+
image create photo gitlogoplus -width 4 -height 4
12301+
gitlogoplus put #008000 -to 1 0 3 4
12302+
gitlogoplus put #008000 -to 0 1 4 3
12303+
gitlogo copy gitlogoplus -to 1 9
12304+
gitlogo copy gitlogoplus -to 6 9
12305+
gitlogo copy gitlogoplus -to 11 9
12306+
image delete gitlogoplus
12307+
12308+
image create photo gitlogo32 -width 32 -height 32
12309+
gitlogo32 copy gitlogo -zoom 2 2
12310+
12311+
wm iconphoto . -default gitlogo gitlogo32
12312+
}
1229412313
}
1229512314
# wait for the window to become visible
1229612315
tkwait visibility .

0 commit comments

Comments
 (0)