Skip to content

Commit

Permalink
Merge 'gitk' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
kasal committed May 29, 2014
2 parents 900f993 + 0543774 commit 83d825b
Showing 1 changed file with 44 additions and 25 deletions.
69 changes: 44 additions & 25 deletions gitk-git/gitk
Expand Up @@ -404,7 +404,7 @@ proc start_rev_list {view} {
if {$revs eq {}} {
return 0
}
set args [concat $vflags($view) $revs]
set args [limit_arg_length [concat $vflags($view) $revs]]
} else {
set args $vorigargs($view)
}
Expand Down Expand Up @@ -9935,7 +9935,8 @@ proc getallcommits {} {
}
}
if {$ids ne {}} {
set fd [open [concat $cmd $ids] r]
set cmd [limit_arg_length [concat $cmd $ids]]
set fd [open $cmd r]
fconfigure $fd -blocking 0
incr allcommits
nowbusy allcommits
Expand All @@ -9945,6 +9946,21 @@ proc getallcommits {} {
}
}

# The maximum command line length for the CreateProcess function is 32767 characters, see
# http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
# Be a little conservative in case Tcl adds some more stuff to the command line we do not
# know about and truncate the command line at a SHA1-boundary below 32000 characters.
proc limit_arg_length {cmd} {
if {[tk windowingsystem] == "win32" &&
[string length $cmd] > 32000} {
set ndx [string last " " $cmd 32000]
if {$ndx != -1} {
return [string range $cmd 0 $ndx]
}
}
return $cmd
}

# Since most commits have 1 parent and 1 child, we group strings of
# such commits into "arcs" joining branch/merge points (BMPs), which
# are commits that either don't have 1 parent or don't have 1 child.
Expand Down Expand Up @@ -12078,7 +12094,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
set gitk_libdir [file join $gitk_prefix share gitk lib]
set gitk_msgsdir [file join $gitk_libdir msgs]
unset gitk_prefix
}

## Internationalization (i18n) through msgcat and gettext. See
Expand Down Expand Up @@ -12257,28 +12272,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
set worktree [exec git rev-parse --show-toplevel]
setcoords
makewindow
catch {
image create photo gitlogo -width 16 -height 16

image create photo gitlogominus -width 4 -height 2
gitlogominus put #C00000 -to 0 0 4 2
gitlogo copy gitlogominus -to 1 5
gitlogo copy gitlogominus -to 6 5
gitlogo copy gitlogominus -to 11 5
image delete gitlogominus

image create photo gitlogoplus -width 4 -height 4
gitlogoplus put #008000 -to 1 0 3 4
gitlogoplus put #008000 -to 0 1 4 3
gitlogo copy gitlogoplus -to 1 9
gitlogo copy gitlogoplus -to 6 9
gitlogo copy gitlogoplus -to 11 9
image delete gitlogoplus

image create photo gitlogo32 -width 32 -height 32
gitlogo32 copy gitlogo -zoom 2 2

wm iconphoto . -default gitlogo gitlogo32
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
wm iconbitmap . -default $gitk_prefix/etc/git.ico
} else {
catch {
image create photo gitlogo -width 16 -height 16

image create photo gitlogominus -width 4 -height 2
gitlogominus put #C00000 -to 0 0 4 2
gitlogo copy gitlogominus -to 1 5
gitlogo copy gitlogominus -to 6 5
gitlogo copy gitlogominus -to 11 5
image delete gitlogominus

image create photo gitlogoplus -width 4 -height 4
gitlogoplus put #008000 -to 1 0 3 4
gitlogoplus put #008000 -to 0 1 4 3
gitlogo copy gitlogoplus -to 1 9
gitlogo copy gitlogoplus -to 6 9
gitlogo copy gitlogoplus -to 11 9
image delete gitlogoplus

image create photo gitlogo32 -width 32 -height 32
gitlogo32 copy gitlogo -zoom 2 2

wm iconphoto . -default gitlogo gitlogo32
}
}
# wait for the window to become visible
tkwait visibility .
Expand Down

0 comments on commit 83d825b

Please sign in to comment.