Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 83d825b

Browse files
committed
Merge 'gitk' into HEAD
2 parents 900f993 + 0543774 commit 83d825b

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
@@ -404,7 +404,7 @@ proc start_rev_list {view} {
404404
if {$revs eq {}} {
405405
return 0
406406
}
407-
set args [concat $vflags($view) $revs]
407+
set args [limit_arg_length [concat $vflags($view) $revs]]
408408
} else {
409409
set args $vorigargs($view)
410410
}
@@ -9935,7 +9935,8 @@ proc getallcommits {} {
99359935
}
99369936
}
99379937
if {$ids ne {}} {
9938-
set fd [open [concat $cmd $ids] r]
9938+
set cmd [limit_arg_length [concat $cmd $ids]]
9939+
set fd [open $cmd r]
99399940
fconfigure $fd -blocking 0
99409941
incr allcommits
99419942
nowbusy allcommits
@@ -9945,6 +9946,21 @@ proc getallcommits {} {
99459946
}
99469947
}
99479948

9949+
# The maximum command line length for the CreateProcess function is 32767 characters, see
9950+
# http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9951+
# Be a little conservative in case Tcl adds some more stuff to the command line we do not
9952+
# know about and truncate the command line at a SHA1-boundary below 32000 characters.
9953+
proc limit_arg_length {cmd} {
9954+
if {[tk windowingsystem] == "win32" &&
9955+
[string length $cmd] > 32000} {
9956+
set ndx [string last " " $cmd 32000]
9957+
if {$ndx != -1} {
9958+
return [string range $cmd 0 $ndx]
9959+
}
9960+
}
9961+
return $cmd
9962+
}
9963+
99489964
# Since most commits have 1 parent and 1 child, we group strings of
99499965
# such commits into "arcs" joining branch/merge points (BMPs), which
99509966
# are commits that either don't have 1 parent or don't have 1 child.
@@ -12078,7 +12094,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1207812094
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1207912095
set gitk_libdir [file join $gitk_prefix share gitk lib]
1208012096
set gitk_msgsdir [file join $gitk_libdir msgs]
12081-
unset gitk_prefix
1208212097
}
1208312098

1208412099
## Internationalization (i18n) through msgcat and gettext. See
@@ -12257,28 +12272,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1225712272
set worktree [exec git rev-parse --show-toplevel]
1225812273
setcoords
1225912274
makewindow
12260-
catch {
12261-
image create photo gitlogo -width 16 -height 16
12262-
12263-
image create photo gitlogominus -width 4 -height 2
12264-
gitlogominus put #C00000 -to 0 0 4 2
12265-
gitlogo copy gitlogominus -to 1 5
12266-
gitlogo copy gitlogominus -to 6 5
12267-
gitlogo copy gitlogominus -to 11 5
12268-
image delete gitlogominus
12269-
12270-
image create photo gitlogoplus -width 4 -height 4
12271-
gitlogoplus put #008000 -to 1 0 3 4
12272-
gitlogoplus put #008000 -to 0 1 4 3
12273-
gitlogo copy gitlogoplus -to 1 9
12274-
gitlogo copy gitlogoplus -to 6 9
12275-
gitlogo copy gitlogoplus -to 11 9
12276-
image delete gitlogoplus
12277-
12278-
image create photo gitlogo32 -width 32 -height 32
12279-
gitlogo32 copy gitlogo -zoom 2 2
12280-
12281-
wm iconphoto . -default gitlogo gitlogo32
12275+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12276+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12277+
} else {
12278+
catch {
12279+
image create photo gitlogo -width 16 -height 16
12280+
12281+
image create photo gitlogominus -width 4 -height 2
12282+
gitlogominus put #C00000 -to 0 0 4 2
12283+
gitlogo copy gitlogominus -to 1 5
12284+
gitlogo copy gitlogominus -to 6 5
12285+
gitlogo copy gitlogominus -to 11 5
12286+
image delete gitlogominus
12287+
12288+
image create photo gitlogoplus -width 4 -height 4
12289+
gitlogoplus put #008000 -to 1 0 3 4
12290+
gitlogoplus put #008000 -to 0 1 4 3
12291+
gitlogo copy gitlogoplus -to 1 9
12292+
gitlogo copy gitlogoplus -to 6 9
12293+
gitlogo copy gitlogoplus -to 11 9
12294+
image delete gitlogoplus
12295+
12296+
image create photo gitlogo32 -width 32 -height 32
12297+
gitlogo32 copy gitlogo -zoom 2 2
12298+
12299+
wm iconphoto . -default gitlogo gitlogo32
12300+
}
1228212301
}
1228312302
# wait for the window to become visible
1228412303
tkwait visibility .

0 commit comments

Comments
 (0)