summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7b64d0b)
raw | patch | inline | side by side (parent: 7b64d0b)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 12 Nov 2006 21:20:36 +0000 (16:20 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 13 Nov 2006 05:10:37 +0000 (00:10 -0500) |
If the user is invoking us as git-citool then they want to perform a
single commit and exit quickly. Since we are about to be a very short
lived process we should do what we can to avoid spending CPU time setting
up menus which the user will never use, like the fetch/push/pull menus.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
single commit and exit quickly. Since we are about to be a very short
lived process we should do what we can to avoid spending CPU time setting
up menus which the user will never use, like the fetch/push/pull menus.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index e59d225cb6c50febe1707404e7fbd7eb3069a18a..249b2c894a3f0b4091d46ad80a298696449b9ea8 100755 (executable)
--- a/git-gui
+++ b/git-gui
}
unset cdup
+set single_commit 0
if {$appname == {git-citool}} {
set single_commit 1
}
##
## task management
-set single_commit 0
set status_active 0
set diff_active 0
set commit_active 0
.mbar add cascade -label Project -menu .mbar.project
.mbar add cascade -label Edit -menu .mbar.edit
.mbar add cascade -label Commit -menu .mbar.commit
-.mbar add cascade -label Fetch -menu .mbar.fetch
-.mbar add cascade -label Pull -menu .mbar.pull
-.mbar add cascade -label Push -menu .mbar.push
+if {!$single_commit} {
+ .mbar add cascade -label Fetch -menu .mbar.fetch
+ .mbar add cascade -label Pull -menu .mbar.pull
+ .mbar add cascade -label Push -menu .mbar.push
+}
. configure -menu .mbar
# -- Project Menu
.mbar.project add command -label Visualize \
-command do_gitk \
-font font_ui
-.mbar.project add command -label {Repack Database} \
- -command do_repack \
- -font font_ui
+if {!$single_commit} {
+ .mbar.project add command -label {Repack Database} \
+ -command do_repack \
+ -font font_ui
+}
.mbar.project add command -label Quit \
-command do_quit \
-accelerator $M1T-Q \
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
-# -- Fetch Menu
-menu .mbar.fetch
+if {!$single_commit} {
+ # -- Fetch Menu
+ menu .mbar.fetch
-# -- Pull Menu
-menu .mbar.pull
+ # -- Pull Menu
+ menu .mbar.pull
-# -- Push Menu
-menu .mbar.push
+ # -- Push Menu
+ menu .mbar.push
+}
# -- Main Window Layout
panedwindow .vpane -orient vertical
wm title . "$appname ([file normalize [file dirname $gitdir]])"
focus -force $ui_comm
-load_all_remotes
-populate_remote_menu .mbar.fetch From fetch_from
-populate_remote_menu .mbar.push To push_to
-populate_pull_menu .mbar.pull
+if {!$single_commit} {
+ load_all_remotes
+ populate_remote_menu .mbar.fetch From fetch_from
+ populate_remote_menu .mbar.push To push_to
+ populate_pull_menu .mbar.pull
+}
after 1 update_status