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 <spearce@spearce.org>
This commit is contained in:
74
git-gui.sh
74
git-gui.sh
@ -630,6 +630,43 @@ You are using [git-version]:
|
|||||||
exit 1
|
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
|
## repository setup
|
||||||
@ -1596,43 +1633,6 @@ set font_descs {
|
|||||||
load_config 0
|
load_config 0
|
||||||
apply_config
|
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
|
## ui construction
|
||||||
|
Reference in New Issue
Block a user