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>
Shawn O. Pearce committed
Jul 17, 2007 at 23:23 UTC
ba7cc6609e5726ddc59158b60ac01f5fc9717ab3
1 file changed
+37
-37
git-gui.sh
+37
-37
@@ -630,6 +630,43 @@ You are using [git-version]:
630
exit 1
631
}
632
633
+######################################################################
634
+##
635
+## feature option selection
636
+
637
+if {[regexp {^git-(.+)$} [appname] _junk subcommand]} {
638
+ unset _junk
639
+} else {
640
+ set subcommand gui
641
+}
642
+if {$subcommand eq {gui.sh}} {
643
+ set subcommand gui
644
+}
645
+if {$subcommand eq {gui} && [llength $argv] > 0} {
646
+ set subcommand [lindex $argv 0]
647
+ set argv [lrange $argv 1 end]
648
+}
649
+
650
+enable_option multicommit
651
+enable_option branch
652
+enable_option transport
653
+
654
+switch -- $subcommand {
655
+browser -
656
+blame {
657
+ disable_option multicommit
658
+ disable_option branch
659
+ disable_option transport
660
+}
661
+citool {
662
+ enable_option singlecommit
663
+
664
+ disable_option multicommit
665
+ disable_option branch
666
+ disable_option transport
667
+}
668
+}
669
+
670
######################################################################
671
##
672
## repository setup
@@ -1596,43 +1633,6 @@ set font_descs {
1633
load_config 0
1634
apply_config
1635
1599
-######################################################################
1600
-##
1601
-## feature option selection
1602
-
1603
-if {[regexp {^git-(.+)$} [appname] _junk subcommand]} {
1604
- unset _junk
1605
-} else {
1606
- set subcommand gui
1607
-}
1608
-if {$subcommand eq {gui.sh}} {
1609
- set subcommand gui
1610
-}
1611
-if {$subcommand eq {gui} && [llength $argv] > 0} {
1612
- set subcommand [lindex $argv 0]
1613
- set argv [lrange $argv 1 end]
1614
-}
1615
-
1616
-enable_option multicommit
1617
-enable_option branch
1618
-enable_option transport
1619
-
1620
-switch -- $subcommand {
1621
-browser -
1622
-blame {
1623
- disable_option multicommit
1624
- disable_option branch
1625
- disable_option transport
1626
-}
1627
-citool {
1628
- enable_option singlecommit
1629
-
1630
- disable_option multicommit
1631
- disable_option branch
1632
- disable_option transport
1633
-}
1634
-}
1635
-
1636
######################################################################
1637
##
1638
## ui construction