From: Shawn O. Pearce Date: Wed, 18 Jul 2007 03:23:56 +0000 (-0400) Subject: git-gui: Move feature option selection before GIT_DIR init X-Git-Tag: gitgui-0.8.0~40 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ba7cc6609e5726ddc59158b60ac01f5fc9717ab3;p=git.git git-gui: Move feature option selection before GIT_DIR init By moving our feature option determination up before we look for GIT_DIR we can make a decision about whether or not we need a working tree up front, before we look for GIT_DIR. A future change could then allow us to start in a bare Git repository if we only need access to the ODB. Signed-off-by: Shawn O. Pearce --- diff --git a/git-gui.sh b/git-gui.sh index 044312979..f13fa80b4 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -630,6 +630,43 @@ You are using [git-version]: exit 1 } +###################################################################### +## +## feature option selection + +if {[regexp {^git-(.+)$} [appname] _junk subcommand]} { + unset _junk +} else { + set subcommand gui +} +if {$subcommand eq {gui.sh}} { + set subcommand gui +} +if {$subcommand eq {gui} && [llength $argv] > 0} { + set subcommand [lindex $argv 0] + set argv [lrange $argv 1 end] +} + +enable_option multicommit +enable_option branch +enable_option transport + +switch -- $subcommand { +browser - +blame { + disable_option multicommit + disable_option branch + disable_option transport +} +citool { + enable_option singlecommit + + disable_option multicommit + disable_option branch + disable_option transport +} +} + ###################################################################### ## ## repository setup @@ -1596,43 +1633,6 @@ set font_descs { load_config 0 apply_config -###################################################################### -## -## feature option selection - -if {[regexp {^git-(.+)$} [appname] _junk subcommand]} { - unset _junk -} else { - set subcommand gui -} -if {$subcommand eq {gui.sh}} { - set subcommand gui -} -if {$subcommand eq {gui} && [llength $argv] > 0} { - set subcommand [lindex $argv 0] - set argv [lrange $argv 1 end] -} - -enable_option multicommit -enable_option branch -enable_option transport - -switch -- $subcommand { -browser - -blame { - disable_option multicommit - disable_option branch - disable_option transport -} -citool { - enable_option singlecommit - - disable_option multicommit - disable_option branch - disable_option transport -} -} - ###################################################################### ## ## ui construction