chiark / gitweb /
Make the 'series --short' length configurable
[stgit] / stgit / config.py
index b56ab1b5186fcfa85d79c18fc198906b5791edbd..a6afbfd057acde62f6e83ce96baa17736ca3f733 100644 (file)
@@ -69,9 +69,11 @@ def config_setup():
     config.set('stgit', 'merger',
                'diff3 -L current -L ancestor -L patched -m -E ' \
                '"%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s"')
+    config.set('stgit', 'autoimerge', 'no')
     config.set('stgit', 'keeporig', 'yes')
     config.set('stgit', 'keepoptimized', 'no')
     config.set('stgit', 'extensions', '.ancestor .current .patched')
+    config.set('stgit', 'shortnr', '5')
 
     # Read the configuration files (if any) and override the default settings
     # stgitrc are read for backward compatibility
@@ -80,8 +82,16 @@ def config_setup():
     config.read(os.path.join(basedir.get(), 'stgitrc'))
 
     # GIT configuration files can have a [stgit] section
-    config.readfp(git_config(os.path.expanduser('~/.gitconfig')))
-    config.readfp(git_config(os.path.join(basedir.get(), 'config')))
+    try:
+        global_config = os.environ['GIT_CONFIG']
+    except KeyError:
+        global_config = os.path.expanduser('~/.gitconfig')
+    try:
+        local_config = os.environ['GIT_CONFIG_LOCAL']
+    except KeyError:
+        local_config = os.path.join(basedir.get(), 'config')
+    config.readfp(git_config(global_config))
+    config.readfp(git_config(local_config))
 
     # Set the PAGER environment to the config value (if any)
     if config.has_option('stgit', 'pager'):