Skip to content

Commit 9620e95

Browse files
committed
Merge 'gitk' into HEAD
2 parents 15a6695 + 02860c5 commit 9620e95

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
}
@@ -10058,7 +10058,8 @@ proc getallcommits {} {
1005810058
}
1005910059
}
1006010060
if {$ids ne {}} {
10061-
set fd [open [concat $cmd $ids] r]
10061+
set cmd [limit_arg_length [concat $cmd $ids]]
10062+
set fd [open $cmd r]
1006210063
fconfigure $fd -blocking 0
1006310064
incr allcommits
1006410065
nowbusy allcommits
@@ -10068,6 +10069,21 @@ proc getallcommits {} {
1006810069
}
1006910070
}
1007010071

10072+
# The maximum command line length for the CreateProcess function is 32767 characters, see
10073+
# http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
10074+
# Be a little conservative in case Tcl adds some more stuff to the command line we do not
10075+
# know about and truncate the command line at a SHA1-boundary below 32000 characters.
10076+
proc limit_arg_length {cmd} {
10077+
if {[tk windowingsystem] == "win32" &&
10078+
[string length $cmd] > 32000} {
10079+
set ndx [string last " " $cmd 32000]
10080+
if {$ndx != -1} {
10081+
return [string range $cmd 0 $ndx]
10082+
}
10083+
}
10084+
return $cmd
10085+
}
10086+
1007110087
# Since most commits have 1 parent and 1 child, we group strings of
1007210088
# such commits into "arcs" joining branch/merge points (BMPs), which
1007310089
# 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
@@ -12433,28 +12448,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1243312448
set worktree [exec git rev-parse --show-toplevel]
1243412449
setcoords
1243512450
makewindow
12436-
catch {
12437-
image create photo gitlogo -width 16 -height 16
12438-
12439-
image create photo gitlogominus -width 4 -height 2
12440-
gitlogominus put #C00000 -to 0 0 4 2
12441-
gitlogo copy gitlogominus -to 1 5
12442-
gitlogo copy gitlogominus -to 6 5
12443-
gitlogo copy gitlogominus -to 11 5
12444-
image delete gitlogominus
12445-
12446-
image create photo gitlogoplus -width 4 -height 4
12447-
gitlogoplus put #008000 -to 1 0 3 4
12448-
gitlogoplus put #008000 -to 0 1 4 3
12449-
gitlogo copy gitlogoplus -to 1 9
12450-
gitlogo copy gitlogoplus -to 6 9
12451-
gitlogo copy gitlogoplus -to 11 9
12452-
image delete gitlogoplus
12453-
12454-
image create photo gitlogo32 -width 32 -height 32
12455-
gitlogo32 copy gitlogo -zoom 2 2
12456-
12457-
wm iconphoto . -default gitlogo gitlogo32
12451+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12452+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12453+
} else {
12454+
catch {
12455+
image create photo gitlogo -width 16 -height 16
12456+
12457+
image create photo gitlogominus -width 4 -height 2
12458+
gitlogominus put #C00000 -to 0 0 4 2
12459+
gitlogo copy gitlogominus -to 1 5
12460+
gitlogo copy gitlogominus -to 6 5
12461+
gitlogo copy gitlogominus -to 11 5
12462+
image delete gitlogominus
12463+
12464+
image create photo gitlogoplus -width 4 -height 4
12465+
gitlogoplus put #008000 -to 1 0 3 4
12466+
gitlogoplus put #008000 -to 0 1 4 3
12467+
gitlogo copy gitlogoplus -to 1 9
12468+
gitlogo copy gitlogoplus -to 6 9
12469+
gitlogo copy gitlogoplus -to 11 9
12470+
image delete gitlogoplus
12471+
12472+
image create photo gitlogo32 -width 32 -height 32
12473+
gitlogo32 copy gitlogo -zoom 2 2
12474+
12475+
wm iconphoto . -default gitlogo gitlogo32
12476+
}
1245812477
}
1245912478
# wait for the window to become visible
1246012479
tkwait visibility .

0 commit comments

Comments
 (0)