diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2008-11-16 21:46:47 +0300 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-11-16 13:33:09 -0800 |
commit | 153ad78b5074b37215654b1ccb59e67dc5831883 (patch) | |
tree | 89e174effc81b0d86b49fceac06920e3848b4621 /git-gui.sh | |
parent | git-gui: try to provide a window icon under X (diff) | |
download | tgif-153ad78b5074b37215654b1ccb59e67dc5831883.tar.xz |
git-gui: Implement system-wide configuration handling.
With the old implementation any system-wide options appear
to be set locally in the current repository. This commit
adds explicit handling of system options, essentially
interpreting them as customized default_config.
The difficulty in interpreting system options stems from
the fact that simple 'git config' lists all values, while
'git config --global' only values set in ~/.gitconfig,
excluding both local and system options.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-x | git-gui.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/git-gui.sh b/git-gui.sh index 6ed6230d3c..f849e745ba 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -940,19 +940,25 @@ git-version proc _parse_config {arr_name args} { } proc load_config {include_global} { - global repo_config global_config default_config + global repo_config global_config system_config default_config if {$include_global} { + _parse_config system_config --system _parse_config global_config --global } _parse_config repo_config foreach name [array names default_config] { + if {[catch {set v $system_config($name)}]} { + set system_config($name) $default_config($name) + } + } + foreach name [array names system_config] { if {[catch {set v $global_config($name)}]} { - set global_config($name) $default_config($name) + set global_config($name) $system_config($name) } if {[catch {set v $repo_config($name)}]} { - set repo_config($name) $default_config($name) + set repo_config($name) $system_config($name) } } } |