From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org, Michael Witten <mfwitten@gmail.com>
Subject: Re: [PATCH 1/3] test-lib.sh: unset XDG_CONFIG_HOME
Date: Tue, 24 Jul 2012 14:06:43 +0200 [thread overview]
Message-ID: <vpqpq7l8iss.fsf@bauges.imag.fr> (raw)
In-Reply-To: <20120724115305.GA7328@sigill.intra.peff.net> (Jeff King's message of "Tue, 24 Jul 2012 07:53:05 -0400")
Thanks (for the 3 patches, all of them look good).
the "unset XDG_CONFIG_HOME" part was already discussed here:
http://thread.gmane.org/gmane.comp.version-control.git/201609
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/t1306-xdg-files.sh b/t/t1306-xdg-files.sh
index 3c75c3f..f1ea9f1 100755
--- a/t/t1306-xdg-files.sh
+++ b/t/t1306-xdg-files.sh
@@ -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 user.name >actual
+ ) &&
+ test_cmp expected actual
+'
+
test_expect_success 'read with --get: xdg file exists and ~/.gitconfig exists' '
>.gitconfig &&
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
next prev parent reply other threads:[~2012-07-24 12:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-24 11:53 [PATCH 1/3] test-lib.sh: unset XDG_CONFIG_HOME Jeff King
2012-07-24 11:53 ` [PATCH 2/3] attr: make sure we have an xdg path before using it Jeff King
2012-07-24 12:26 ` [PATCH] ignore: " Matthieu Moy
2012-07-24 13:32 ` Jeff King
2012-07-24 11:54 ` [PATCH 3/3] t1306: check that XDG_CONFIG_HOME works Jeff King
2012-07-24 12:06 ` Matthieu Moy [this message]
2012-07-24 12:27 ` [PATCH 1/3] test-lib.sh: unset XDG_CONFIG_HOME Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vpqpq7l8iss.fsf@bauges.imag.fr \
--to=matthieu.moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mfwitten@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).