Thanks (for the 3 patches, all of them look good).

the "unset XDG_CONFIG_HOME" part was already discussed here:

But Michael did not continue the thread. I think your solution (unset
$XDG_CONFIG_HOME instead of setting it to $HOME/.config/git) is better.

In the thread above, I also proposed checking that $XDG_CONFIG_HOME was
taken into account, but for the "git config" part (while you test the
attributes part).

I think it makes sense to add stg like this to your PATCH 3:

diff --git a/t/ b/t/
index 3c75c3f..f1ea9f1 100755
--- a/t/
+++ b/t/
@@ -38,6 +38,19 @@ test_expect_success 'read with --get: xdg file exists and 
~/.gitconfig doesn'\''
        test_cmp expected actual

+test_expect_success '"$XDG_CONFIG_HOME overrides $HOME/.config/git' '
+       mkdir -p "$HOME"/xdg/git/ &&
+       echo "[user]" >"$HOME"/xdg/git/config &&
+       echo "  name = in_xdg" >>"$HOME"/xdg/git/config &&
+       echo in_xdg >expected &&
+       (
+               XDG_CONFIG_HOME="$HOME"/xdg/ &&
+               export XDG_CONFIG_HOME &&
+               git config --get-all >actual
+       ) &&
+       test_cmp expected actual

 test_expect_success 'read with --get: xdg file exists and ~/.gitconfig exists' 
        >.gitconfig &&

Matthieu Moy
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to