Skip to content

Commit 7ae1e72

Browse files
committed
git-gui: show command-line errors in a messagebox on Windows
Signed-off-by: Pat Thoyts <[email protected]>
1 parent ff9db6c commit 7ae1e72

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

git-gui.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2863,7 +2863,8 @@ proc usage {} {
28632863
set s "usage: $::argv0 $::subcommand $::subcommand_args"
28642864
if {[tk windowingsystem] eq "win32"} {
28652865
wm withdraw .
2866-
tk_messageBox -icon info -title "Usage" -message $s
2866+
tk_messageBox -icon info -message $s \
2867+
-title [mc "Usage"]
28672868
} else {
28682869
puts stderr $s
28692870
}
@@ -2936,7 +2937,11 @@ blame {
29362937
if {[catch {
29372938
set head [git rev-parse --verify $head]
29382939
} err]} {
2939-
puts stderr $err
2940+
if {[tk windowingsystem] eq "win32"} {
2941+
tk_messageBox -icon error -title [mc Error] -message $err
2942+
} else {
2943+
puts stderr $err
2944+
}
29402945
exit 1
29412946
}
29422947
}
@@ -2975,18 +2980,19 @@ blame {
29752980
citool -
29762981
gui {
29772982
if {[llength $argv] != 0} {
2978-
puts -nonewline stderr "usage: $argv0"
2979-
if {$subcommand ne {gui}
2980-
&& [file tail $argv0] ne "git-$subcommand"} {
2981-
puts -nonewline stderr " $subcommand"
2982-
}
2983-
puts stderr {}
2984-
exit 1
2983+
usage
29852984
}
29862985
# fall through to setup UI for commits
29872986
}
29882987
default {
2989-
puts stderr "usage: $argv0 \[{blame|browser|citool}\]"
2988+
set err "usage: $argv0 \[{blame|browser|citool}\]"
2989+
if {[tk windowingsystem] eq "win32"} {
2990+
wm withdraw .
2991+
tk_messageBox -icon error -message $err \
2992+
-title [mc "Usage"]
2993+
} else {
2994+
puts stderr $err
2995+
}
29902996
exit 1
29912997
}
29922998
}

0 commit comments

Comments
 (0)