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

Commit 39bd86a

Browse files
committed
Merge 'gitk' into HEAD
2 parents 3ac701b + a325ef9 commit 39bd86a

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
}
@@ -9970,7 +9970,8 @@ proc getallcommits {} {
99709970
}
99719971
}
99729972
if {$ids ne {}} {
9973-
set fd [open [concat $cmd $ids] r]
9973+
set cmd [limit_arg_length [concat $cmd $ids]]
9974+
set fd [open $cmd r]
99749975
fconfigure $fd -blocking 0
99759976
incr allcommits
99769977
nowbusy allcommits
@@ -9980,6 +9981,21 @@ proc getallcommits {} {
99809981
}
99819982
}
99829983

9984+
# The maximum command line length for the CreateProcess function is 32767 characters, see
9985+
# http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
9986+
# Be a little conservative in case Tcl adds some more stuff to the command line we do not
9987+
# know about and truncate the command line at a SHA1-boundary below 32000 characters.
9988+
proc limit_arg_length {cmd} {
9989+
if {[tk windowingsystem] == "win32" &&
9990+
[string length $cmd] > 32000} {
9991+
set ndx [string last " " $cmd 32000]
9992+
if {$ndx != -1} {
9993+
return [string range $cmd 0 $ndx]
9994+
}
9995+
}
9996+
return $cmd
9997+
}
9998+
99839999
# Since most commits have 1 parent and 1 child, we group strings of
998410000
# such commits into "arcs" joining branch/merge points (BMPs), which
998510001
# are commits that either don't have 1 parent or don't have 1 child.
@@ -12136,7 +12152,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1213612152
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1213712153
set gitk_libdir [file join $gitk_prefix share gitk lib]
1213812154
set gitk_msgsdir [file join $gitk_libdir msgs]
12139-
unset gitk_prefix
1214012155
}
1214112156

1214212157
## Internationalization (i18n) through msgcat and gettext. See
@@ -12315,28 +12330,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1231512330
set worktree [exec git rev-parse --show-toplevel]
1231612331
setcoords
1231712332
makewindow
12318-
catch {
12319-
image create photo gitlogo -width 16 -height 16
12320-
12321-
image create photo gitlogominus -width 4 -height 2
12322-
gitlogominus put #C00000 -to 0 0 4 2
12323-
gitlogo copy gitlogominus -to 1 5
12324-
gitlogo copy gitlogominus -to 6 5
12325-
gitlogo copy gitlogominus -to 11 5
12326-
image delete gitlogominus
12327-
12328-
image create photo gitlogoplus -width 4 -height 4
12329-
gitlogoplus put #008000 -to 1 0 3 4
12330-
gitlogoplus put #008000 -to 0 1 4 3
12331-
gitlogo copy gitlogoplus -to 1 9
12332-
gitlogo copy gitlogoplus -to 6 9
12333-
gitlogo copy gitlogoplus -to 11 9
12334-
image delete gitlogoplus
12335-
12336-
image create photo gitlogo32 -width 32 -height 32
12337-
gitlogo32 copy gitlogo -zoom 2 2
12338-
12339-
wm iconphoto . -default gitlogo gitlogo32
12333+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12334+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12335+
} else {
12336+
catch {
12337+
image create photo gitlogo -width 16 -height 16
12338+
12339+
image create photo gitlogominus -width 4 -height 2
12340+
gitlogominus put #C00000 -to 0 0 4 2
12341+
gitlogo copy gitlogominus -to 1 5
12342+
gitlogo copy gitlogominus -to 6 5
12343+
gitlogo copy gitlogominus -to 11 5
12344+
image delete gitlogominus
12345+
12346+
image create photo gitlogoplus -width 4 -height 4
12347+
gitlogoplus put #008000 -to 1 0 3 4
12348+
gitlogoplus put #008000 -to 0 1 4 3
12349+
gitlogo copy gitlogoplus -to 1 9
12350+
gitlogo copy gitlogoplus -to 6 9
12351+
gitlogo copy gitlogoplus -to 11 9
12352+
image delete gitlogoplus
12353+
12354+
image create photo gitlogo32 -width 32 -height 32
12355+
gitlogo32 copy gitlogo -zoom 2 2
12356+
12357+
wm iconphoto . -default gitlogo gitlogo32
12358+
}
1234012359
}
1234112360
# wait for the window to become visible
1234212361
tkwait visibility .

0 commit comments

Comments
 (0)