summaryrefslogtreecommitdiff
path: root/git-gui
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-11-21 20:33:09 -0500
committerShawn O. Pearce <spearce@spearce.org>2006-11-21 22:34:27 -0500
commitd075242923691e5f3c671f240945b0bdf26a7cd0 (patch)
treeeb36dccebabee307b731a5c9f26f488f957f66f4 /git-gui
parentb673bbc59cf6950808d12b0d4020ae606019a8cd (diff)
downloadgit-d075242923691e5f3c671f240945b0bdf26a7cd0.tar.gz
git-gui: Added menu command to visualize all branches.
Sometimes its useful to start gitk with the --all option, to view all of the known branches and tags within this repository. Rather than making the user startup gitk and then edit the view we can pass the option along for them. This also makes it slightly more explicit, that when gitk starts up by default its showing the current branch and not everything. Yes gitk isn't showing that to the user, but the fact that the user had to make a decision between seeing this current branch or all branches will hopefully make them study gitk's display before jumping to a conclusion. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui39
1 files changed, 26 insertions, 13 deletions
diff --git a/git-gui b/git-gui
index 13b40823ee..ef8c7cf065 100755
--- a/git-gui
+++ b/git-gui
@@ -1959,20 +1959,28 @@ proc console_read {w fd after} {
set starting_gitk_msg {Please wait... Starting gitk...}
-proc do_gitk {} {
+proc do_gitk {revs} {
global ui_status_value starting_gitk_msg
- set ui_status_value $starting_gitk_msg
- after 10000 {
- if {$ui_status_value eq $starting_gitk_msg} {
- set ui_status_value {Ready.}
- }
+ set cmd gitk
+ if {$revs ne {}} {
+ append cmd { }
+ append cmd $revs
}
-
if {[is_Windows]} {
- exec sh -c gitk &
+ set cmd "sh -c \"exec $cmd\""
+ }
+ append cmd { &}
+
+ if {[catch {eval exec $cmd} err]} {
+ error_popup "Failed to start gitk:\n\n$err"
} else {
- exec gitk &
+ set ui_status_value $starting_gitk_msg
+ after 10000 {
+ if {$ui_status_value eq $starting_gitk_msg} {
+ set ui_status_value {Ready.}
+ }
+ }
}
}
@@ -2701,12 +2709,17 @@ if {!$single_commit} {
# -- Repository Menu
#
menu .mbar.repository
-.mbar.repository add command -label Visualize \
- -command do_gitk \
+.mbar.repository add command \
+ -label {Visualize Current Branch} \
+ -command {do_gitk {}} \
-font font_ui
-if {!$single_commit} {
- .mbar.repository add separator
+.mbar.repository add command \
+ -label {Visualize All Branches} \
+ -command {do_gitk {--all}} \
+ -font font_ui
+.mbar.repository add separator
+if {!$single_commit} {
.mbar.repository add command -label {Repack Database} \
-command do_repack \
-font font_ui