{"thread":{"id":"41727","subject":"[PATCH v2/GSoC 1/4] path.c: implement strbuf_mkpath()","startedAt":"2016-03-17T16:48:43Z","lastAt":"2016-03-18T05:22:48Z","messageCount":9,"participants":["Hui Yiqun","Jeff King","惠轶群"],"isPatch":true,"patchVersion":2,"patchTotal":4},"messages":[{"id":"281049","messageId":"1458233326-7735-1-git-send-email-huiyiqun@gmail.com","threadId":"41727","inReplyTo":null,"subject":"[PATCH v2/GSoC 1/4] path.c: implement strbuf_mkpath()","fromName":"Hui Yiqun","fromEmail":"huiyiqun@gmail.com","sentAt":"2016-03-17T16:48:43Z","receivedAt":"2016-03-17T16:48:43Z","isPatch":true,"sender":{"key":"huiyiqun@gmail.com","avatar":"https://gravatar.com/avatar/44aa01fbc2fb098682386b82a44aac03bd778275249228c55d09c5b6fe2fe0e0?d=mp&s=160"},"body":"Common logic of mkpath() and mkpathdup() are collected into a\nnew do_mkpath(). Then, based on do_mkpath(), strbuf_mkpath() is\nimplemented.\n\nSigned-off-by: Hui Yiqun <huiyiqun@gmail.com>\n---\n cache.h |  2 ++\n path.c  | 21 +++++++++++++++++----\n 2 files changed, 19 insertions(+), 4 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex b829410..ef843c1 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -781,6 +781,8 @@ extern char *git_pathdup(const char *fmt, ...)\n \t__attribute__((format (printf, 1, 2)));\n extern char *mkpathdup(const char *fmt, ...)\n \t__attribute__((format (printf, 1, 2)));\n+extern void strbuf_mkpath(struct strbuf *sb, const char *fmt, ...)\n+\t__attribute__((format (printf, 2, 3)));\n extern char *git_pathdup_submodule(const char *path, const char *fmt, ...)\n \t__attribute__((format (printf, 2, 3)));\n \ndiff --git a/path.c b/path.c\nindex 8b7e168..699af68 100644\n--- a/path.c\n+++ b/path.c\n@@ -433,14 +433,19 @@ char *git_pathdup(const char *fmt, ...)\n \treturn strbuf_detach(&path, NULL);\n }\n \n+static void do_mkpath(struct strbuf *buf, const char *fmt, va_list args)\n+{\n+\tstrbuf_vaddf(buf, fmt, args);\n+\tstrbuf_cleanup_path(buf);\n+}\n+\n char *mkpathdup(const char *fmt, ...)\n {\n \tstruct strbuf sb = STRBUF_INIT;\n \tva_list args;\n \tva_start(args, fmt);\n-\tstrbuf_vaddf(&sb, fmt, args);\n+\tdo_mkpath(&sb, fmt, args);\n \tva_end(args);\n-\tstrbuf_cleanup_path(&sb);\n \treturn strbuf_detach(&sb, NULL);\n }\n \n@@ -449,9 +454,17 @@ const char *mkpath(const char *fmt, ...)\n \tva_list args;\n \tstruct strbuf *pathname = get_pathname();\n \tva_start(args, fmt);\n-\tstrbuf_vaddf(pathname, fmt, args);\n+\tdo_mkpath(pathname, fmt, args);\n+\tva_end(args);\n+\treturn pathname->buf;\n+}\n+\n+void strbuf_mkpath(struct strbuf *buf, const char *fmt, ...)\n+{\n+\tva_list args;\n+\tva_start(args, fmt);\n+\tdo_mkpath(buf, fmt, args);\n \tva_end(args);\n-\treturn cleanup_path(pathname->buf);\n }\n \n static void do_submodule_path(struct strbuf *buf, const char *path,\n-- \n2.7.3\n"},{"id":"281050","messageId":"1458233326-7735-2-git-send-email-huiyiqun@gmail.com","threadId":"41727","inReplyTo":"1458233326-7735-1-git-send-email-huiyiqun@gmail.com","subject":"[PATCH v2/GSoC 2/4] path.c: implement xdg_runtime_dir()","fromName":"Hui Yiqun","fromEmail":"huiyiqun@gmail.com","sentAt":"2016-03-17T16:48:44Z","receivedAt":"2016-03-17T16:48:44Z","isPatch":true,"sender":{"key":"huiyiqun@gmail.com","avatar":"https://gravatar.com/avatar/44aa01fbc2fb098682386b82a44aac03bd778275249228c55d09c5b6fe2fe0e0?d=mp&s=160"},"body":"this function does the following:\n\n1. if $XDG_RUNTIME_DIR is non-empty, `$XDG_RUNTIME_DIR/git` is used in next\nstep, otherwise `/tmp/git-$uid` is taken.\n2. ensure that above directory does exist. what's more, it must has correct\npermission and ownership.\n3. a newly allocated string consisting of the path of above directory and\n$filename is returned.\n\nUnder following situation, NULL will be returned:\n+ the directory mentioned in step 1 exists but have wrong permission or\nownership.\n+ the directory or its parent cannot be created.\n\nNotice:\n\n+ the caller is responsible for deallocating the returned string.\n\nSigned-off-by: Hui Yiqun <huiyiqun@gmail.com>\n---\n cache.h | 23 +++++++++++++++++++++++\n path.c  | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 79 insertions(+)\n\ndiff --git a/cache.h b/cache.h\nindex ef843c1..f8b649b 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1001,6 +1001,29 @@ extern int is_ntfs_dotgit(const char *name);\n  */\n extern char *xdg_config_home(const char *filename);\n \n+/**\n+ * this function does the following:\n+ *\n+ * 1. if $XDG_RUNTIME_DIR is non-empty, `$XDG_RUNTIME_DIR/git` is used in next\n+ * step, otherwise `/tmp/git-$uid` is taken.\n+ * 2. ensure that above directory does exist. what's more, it must has correct\n+ * permission and ownership.\n+ * 3. a newly allocated string consisting of the path of above directory and\n+ * $filename is returned.\n+ *\n+ * Under following situation, NULL will be returned:\n+ *\n+ * + the directory mentioned in step 1 exists but have wrong permission or\n+ * ownership.\n+ * + the directory or its parent cannot be created.\n+ *\n+ * Notice:\n+ *\n+ * + the caller is responsible for deallocating the returned string.\n+ *\n+ */\n+extern char *xdg_runtime_dir(const char *filename);\n+\n /* object replacement */\n #define LOOKUP_REPLACE_OBJECT 1\n #define LOOKUP_UNKNOWN_OBJECT 2\ndiff --git a/path.c b/path.c\nindex 699af68..2886e59 100644\n--- a/path.c\n+++ b/path.c\n@@ -5,6 +5,7 @@\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"dir.h\"\n+#include \"git-compat-util.h\"\n \n static int get_st_mode_bits(const char *path, int *mode)\n {\n@@ -1206,6 +1207,61 @@ char *xdg_config_home(const char *filename)\n \treturn NULL;\n }\n \n+char *xdg_runtime_dir(const char *filename)\n+{\n+\tstruct strbuf sb = STRBUF_INIT;\n+\tchar *runtime_dir;\n+\tstruct stat st;\n+\tuid_t uid = getuid();\n+\n+\tassert(filename);\n+\truntime_dir = getenv(\"XDG_RUNTIME_DIR\");\n+\tif (runtime_dir && *runtime_dir)\n+\t\tstrbuf_mkpath(&sb, \"%s/git/\", runtime_dir);\n+\telse\n+\t\tstrbuf_mkpath(&sb, \"/tmp/git-%d\", uid);\n+\n+\tif (!lstat(sb.buf, &st)) {\n+\t\t/*\n+\t\t * As described in XDG base dir spec[1], the subdirectory\n+\t\t * under $XDG_RUNTIME_DIR or its fallback MUST be owned by\n+\t\t * the user, and its unix access mode MUST be 0700.\n+\t\t *\n+\t\t * Calling chmod or chown silently may cause security\n+\t\t * problem if somebody chdir to it, sleep, and then, try\n+\t\t * to open our protected runtime cache or socket.\n+\t\t * So we just put warning and left it to user to solve.\n+\t\t *\n+\t\t * [1]https://specifications.freedesktop.org/basedir-spec/\n+\t\t * basedir-spec-latest.html\n+\t\t */\n+\t\tif ((st.st_mode & 0777) != S_IRWXU) {\n+\t\t\twarning(\"permission of runtime directory '%s' \"\n+\t\t\t\t\t\"MUST be 0700 instead of 0%o\\n\",\n+\t\t\t\t\tsb.buf, (st.st_mode & 0777));\n+\t\t\treturn NULL;\n+\t\t} else if (st.st_uid != uid) {\n+\t\t\twarning(\"owner of runtime directory '%s' \"\n+\t\t\t\t\t\"MUST be %d instead of %d\\n\",\n+\t\t\t\t\tsb.buf, uid, st.st_uid);\n+\t\t\treturn NULL;\n+\t\t}\n+\t\t/* TODO: check whether st.buf is an directory */\n+\t} else {\n+\t\tif (safe_create_leading_directories_const(sb.buf) < 0) {\n+\t\t\twarning(\"unable to create directories for '%s'\\n\",\n+\t\t\t\t\tsb.buf);\n+\t\t\treturn NULL;\n+\t\t}\n+\t\tif (mkdir(sb.buf, 0700) < 0) {\n+\t\t\twarning(\"unable to mkdir '%s'\\n\", sb.buf);\n+\t\t\treturn NULL;\n+\t\t}\n+\t}\n+\tstrbuf_addf(&sb, \"/%s\", filename);\n+\treturn strbuf_detach(&sb, NULL);\n+}\n+\n GIT_PATH_FUNC(git_path_cherry_pick_head, \"CHERRY_PICK_HEAD\")\n GIT_PATH_FUNC(git_path_revert_head, \"REVERT_HEAD\")\n GIT_PATH_FUNC(git_path_squash_msg, \"SQUASH_MSG\")\n-- \n2.7.3\n"},{"id":"281051","messageId":"1458233326-7735-3-git-send-email-huiyiqun@gmail.com","threadId":"41727","inReplyTo":"1458233326-7735-1-git-send-email-huiyiqun@gmail.com","subject":"[PATCH v2/GSoC 3/4] git-credential-cache: put socket to xdg-compatible path","fromName":"Hui Yiqun","fromEmail":"huiyiqun@gmail.com","sentAt":"2016-03-17T16:48:45Z","receivedAt":"2016-03-17T16:48:45Z","isPatch":true,"sender":{"key":"huiyiqun@gmail.com","avatar":"https://gravatar.com/avatar/44aa01fbc2fb098682386b82a44aac03bd778275249228c55d09c5b6fe2fe0e0?d=mp&s=160"},"body":"move .git-credential-cache/socket to xdg_runtime_dir(\"credential-cache.sock\")\n\nSigned-off-by: Hui Yiqun <huiyiqun@gmail.com>\n---\n credential-cache.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/credential-cache.c b/credential-cache.c\nindex f4afdc6..40d838b 100644\n--- a/credential-cache.c\n+++ b/credential-cache.c\n@@ -105,7 +105,7 @@ int main(int argc, const char **argv)\n \top = argv[0];\n \n \tif (!socket_path)\n-\t\tsocket_path = expand_user_path(\"~/.git-credential-cache/socket\");\n+\t\tsocket_path = xdg_runtime_dir(\"credential-cache.sock\");\n \tif (!socket_path)\n \t\tdie(\"unable to find a suitable socket path; use --socket\");\n \n-- \n2.7.3\n"},{"id":"281052","messageId":"1458233326-7735-4-git-send-email-huiyiqun@gmail.com","threadId":"41727","inReplyTo":"1458233326-7735-1-git-send-email-huiyiqun@gmail.com","subject":"[PATCH v2/GSoC 4/4] t0301: test credential-cache support of XDG_RUNTIME_DIR","fromName":"Hui Yiqun","fromEmail":"huiyiqun@gmail.com","sentAt":"2016-03-17T16:48:46Z","receivedAt":"2016-03-17T16:48:46Z","isPatch":true,"sender":{"key":"huiyiqun@gmail.com","avatar":"https://gravatar.com/avatar/44aa01fbc2fb098682386b82a44aac03bd778275249228c55d09c5b6fe2fe0e0?d=mp&s=160"},"body":"t0301 now tests git-credential-cache support for XDG user-specific\nruntime file $XDG_RUNTIME_DIR/git/credential.sock. Specifically:\n\n* if $XDG_RUNTIME_DIR exists, use socket at\n  `$XDG_RUNTIME_DIR/git/credential-cache.sock`.\n\n* otherwise, `/tmp/git-$uid/credential-cache.sock` is taken.\n\nSigned-off-by: Hui Yiqun <huiyiqun@gmail.com>\n---\n t/t0301-credential-cache.sh | 27 +++++++++++++++++++++++++++\n 1 file changed, 27 insertions(+)\n\ndiff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh\nindex 82c8411..892d1ba 100755\n--- a/t/t0301-credential-cache.sh\n+++ b/t/t0301-credential-cache.sh\n@@ -12,7 +12,34 @@ test -z \"$NO_UNIX_SOCKETS\" || {\n # don't leave a stale daemon running\n trap 'code=$?; git credential-cache exit; (exit $code); die' EXIT\n \n+test_expect_success 'set $XDG_RUNTIME_DIR' '\n+\tXDG_RUNTIME_DIR=$HOME/xdg_runtime/\n+'\n+\n+helper_test cache\n+\n+test_expect_success 'when $XDG_RUNTIME_DIR is set, `$XDG_RUNTIME_DIR/git` are used' '\n+\ttest_path_is_missing \"/tmp/git-$(id -u)/git/credential-cache.sock\" &&\n+\ttest -S \"$HOME/xdg_runtime/git/credential-cache.sock\"\n+'\n+\n+test_expect_success 'force git-credential-cache to exit so that socket disappear' '\n+\tgit credential-cache exit &&\n+\ttest_path_is_missing \"$XDG_RUNTIME_DIR/git/credential-cache.sock\" &&\n+\tunset XDG_RUNTIME_DIR\n+'\n+\n helper_test cache\n+\n+test_expect_success 'when $XDG_RUNTIME_DIR is not set, `/tmp/git-$(id -u) is used' '\n+\ttest -S \"/tmp/git-$(id -u)/credential-cache.sock\"\n+'\n+\n+# TODO: if $XDG_RUNTIME_DIR/git/ exists, but has wrong permission and ownership,\n+# `helper_test cache` must fail.\n+\n+# TODO: check whether `--socket` works\n+\n helper_test_timeout cache --timeout=1\n \n # we can't rely on our \"trap\" above working after test_done,\n-- \n2.7.3\n"},{"id":"281060","messageId":"20160317180811.GA23669@sigill.intra.peff.net","threadId":"41727","inReplyTo":"1458233326-7735-4-git-send-email-huiyiqun@gmail.com","subject":"Re: [PATCH v2/GSoC 4/4] t0301: test credential-cache support of XDG_RUNTIME_DIR","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-03-17T18:08:12Z","receivedAt":"2016-03-17T18:08:12Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Mar 18, 2016 at 12:48:46AM +0800, Hui Yiqun wrote:\n\n> t0301 now tests git-credential-cache support for XDG user-specific\n> runtime file $XDG_RUNTIME_DIR/git/credential.sock. Specifically:\n> \n> * if $XDG_RUNTIME_DIR exists, use socket at\n>   `$XDG_RUNTIME_DIR/git/credential-cache.sock`.\n> \n> * otherwise, `/tmp/git-$uid/credential-cache.sock` is taken.\n> \n> Signed-off-by: Hui Yiqun <huiyiqun@gmail.com>\n> ---\n>  t/t0301-credential-cache.sh | 27 +++++++++++++++++++++++++++\n>  1 file changed, 27 insertions(+)\n> \n> diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh\n> index 82c8411..892d1ba 100755\n> --- a/t/t0301-credential-cache.sh\n> +++ b/t/t0301-credential-cache.sh\n> @@ -12,7 +12,34 @@ test -z \"$NO_UNIX_SOCKETS\" || {\n>  # don't leave a stale daemon running\n>  trap 'code=$?; git credential-cache exit; (exit $code); die' EXIT\n>  \n> +test_expect_success 'set $XDG_RUNTIME_DIR' '\n> +\tXDG_RUNTIME_DIR=$HOME/xdg_runtime/\n> +'\n> +\n> +helper_test cache\n> +\n> +test_expect_success 'when $XDG_RUNTIME_DIR is set, `$XDG_RUNTIME_DIR/git` are used' '\n> +\ttest_path_is_missing \"/tmp/git-$(id -u)/git/credential-cache.sock\" &&\n> +\ttest -S \"$HOME/xdg_runtime/git/credential-cache.sock\"\n> +'\n\nThis test fails for me, probably because XDG_RUNTIME_DIR is not\nexported.\n\n-Peff\n"},{"id":"281063","messageId":"20160317181311.GB23669@sigill.intra.peff.net","threadId":"41727","inReplyTo":"1458233326-7735-2-git-send-email-huiyiqun@gmail.com","subject":"Re: [PATCH v2/GSoC 2/4] path.c: implement xdg_runtime_dir()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-03-17T18:13:11Z","receivedAt":"2016-03-17T18:13:11Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Mar 18, 2016 at 12:48:44AM +0800, Hui Yiqun wrote:\n\n> this function does the following:\n> \n> 1. if $XDG_RUNTIME_DIR is non-empty, `$XDG_RUNTIME_DIR/git` is used in next\n> step, otherwise `/tmp/git-$uid` is taken.\n> 2. ensure that above directory does exist. what's more, it must has correct\n> permission and ownership.\n> 3. a newly allocated string consisting of the path of above directory and\n> $filename is returned.\n> \n> Under following situation, NULL will be returned:\n> + the directory mentioned in step 1 exists but have wrong permission or\n> ownership.\n> + the directory or its parent cannot be created.\n> \n> Notice:\n> \n> + the caller is responsible for deallocating the returned string.\n\nI see a lot of \"what\" in your commit message (and in the other ones in\nthis series), but not a lot of \"why\".\n\nWe can see the \"what\" from the diff already (though it is certainly OK\nto point out tricky parts). But you probably want to explain the\nmotivation for things, alternatives considered, etc, like:\n\n  - why is using $XDG_RUNTIME_DIR a good thing?\n\n  - why did you choose to fall back to /tmp (as opposed to, say,\n    returning NULL and letting the caller handle it)\n\n  - what is the purpose of the ownership/permission rules? You link to\n    the XDG spec in an in-code comment, but IMHO that kind of motivation\n    probably makes more sense in the commit message.\n\n-Peff\n"},{"id":"281109","messageId":"CAKqreuy0jU7WOi8_iGXR2hzYJE0kG8855hQuaeaW9OTKm3yF_Q@mail.gmail.com","threadId":"41727","inReplyTo":"20160317180811.GA23669@sigill.intra.peff.net","subject":"Re: [PATCH v2/GSoC 4/4] t0301: test credential-cache support of XDG_RUNTIME_DIR","fromName":"惠轶群","fromEmail":"huiyiqun@gmail.com","sentAt":"2016-03-18T04:38:16Z","receivedAt":"2016-03-18T04:38:16Z","isPatch":true,"sender":{"key":"huiyiqun@gmail.com","avatar":"https://gravatar.com/avatar/44aa01fbc2fb098682386b82a44aac03bd778275249228c55d09c5b6fe2fe0e0?d=mp&s=160"},"body":"2016-03-18 2:08 GMT+08:00 Jeff King <peff@peff.net>:\n> On Fri, Mar 18, 2016 at 12:48:46AM +0800, Hui Yiqun wrote:\n>\n>> t0301 now tests git-credential-cache support for XDG user-specific\n>> runtime file $XDG_RUNTIME_DIR/git/credential.sock. Specifically:\n>>\n>> * if $XDG_RUNTIME_DIR exists, use socket at\n>>   `$XDG_RUNTIME_DIR/git/credential-cache.sock`.\n>>\n>> * otherwise, `/tmp/git-$uid/credential-cache.sock` is taken.\n>>\n>> Signed-off-by: Hui Yiqun <huiyiqun@gmail.com>\n>> ---\n>>  t/t0301-credential-cache.sh | 27 +++++++++++++++++++++++++++\n>>  1 file changed, 27 insertions(+)\n>>\n>> diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh\n>> index 82c8411..892d1ba 100755\n>> --- a/t/t0301-credential-cache.sh\n>> +++ b/t/t0301-credential-cache.sh\n>> @@ -12,7 +12,34 @@ test -z \"$NO_UNIX_SOCKETS\" || {\n>>  # don't leave a stale daemon running\n>>  trap 'code=$?; git credential-cache exit; (exit $code); die' EXIT\n>>\n>> +test_expect_success 'set $XDG_RUNTIME_DIR' '\n>> +     XDG_RUNTIME_DIR=$HOME/xdg_runtime/\n>> +'\n>> +\n>> +helper_test cache\n>> +\n>> +test_expect_success 'when $XDG_RUNTIME_DIR is set, `$XDG_RUNTIME_DIR/git` are used' '\n>> +     test_path_is_missing \"/tmp/git-$(id -u)/git/credential-cache.sock\" &&\n>> +     test -S \"$HOME/xdg_runtime/git/credential-cache.sock\"\n>> +'\n>\n> This test fails for me, probably because XDG_RUNTIME_DIR is not\n> exported.\n>\n> -Peff\n\nCould you please give a try to the patch set v2, test of which is\ndefinitely passed on my computer.\n"},{"id":"281113","messageId":"20160318050124.GB22327@sigill.intra.peff.net","threadId":"41727","inReplyTo":"CAKqreuy0jU7WOi8_iGXR2hzYJE0kG8855hQuaeaW9OTKm3yF_Q@mail.gmail.com","subject":"Re: [PATCH v2/GSoC 4/4] t0301: test credential-cache support of XDG_RUNTIME_DIR","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-03-18T05:01:24Z","receivedAt":"2016-03-18T05:01:24Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Mar 18, 2016 at 12:38:16PM +0800, 惠轶群 wrote:\n\n> >> +test_expect_success 'when $XDG_RUNTIME_DIR is set, `$XDG_RUNTIME_DIR/git` are used' '\n> >> +     test_path_is_missing \"/tmp/git-$(id -u)/git/credential-cache.sock\" &&\n> >> +     test -S \"$HOME/xdg_runtime/git/credential-cache.sock\"\n> >> +'\n> >\n> > This test fails for me, probably because XDG_RUNTIME_DIR is not\n> > exported.\n> >\n> > -Peff\n> \n> Could you please give a try to the patch set v2, test of which is\n> definitely passed on my computer.\n\nYes, that was what I tried earlier (and I just re-tested to make sure).\nIt still fails. I suspect it has to do with whether XDG_RUNTIME_DIR is\nset in our environments (outside of the test suite). If I run:\n\n  XDG_RUNTIME_DIR=/tmp/foo ./t0301-credential-cache.sh\n\nit passes.\n\n-Peff\n"},{"id":"281116","messageId":"CAKqreuy8GQygYVvSBnrEU07E-4=1ajiMSSStPjqXp6t=xpNuXQ@mail.gmail.com","threadId":"41727","inReplyTo":"20160318050124.GB22327@sigill.intra.peff.net","subject":"Re: [PATCH v2/GSoC 4/4] t0301: test credential-cache support of XDG_RUNTIME_DIR","fromName":"惠轶群","fromEmail":"huiyiqun@gmail.com","sentAt":"2016-03-18T05:22:48Z","receivedAt":"2016-03-18T05:22:48Z","isPatch":true,"sender":{"key":"huiyiqun@gmail.com","avatar":"https://gravatar.com/avatar/44aa01fbc2fb098682386b82a44aac03bd778275249228c55d09c5b6fe2fe0e0?d=mp&s=160"},"body":"2016-03-18 13:01 GMT+08:00 Jeff King <peff@peff.net>:\n> On Fri, Mar 18, 2016 at 12:38:16PM +0800, 惠轶群 wrote:\n>\n>> >> +test_expect_success 'when $XDG_RUNTIME_DIR is set, `$XDG_RUNTIME_DIR/git` are used' '\n>> >> +     test_path_is_missing \"/tmp/git-$(id -u)/git/credential-cache.sock\" &&\n>> >> +     test -S \"$HOME/xdg_runtime/git/credential-cache.sock\"\n>> >> +'\n>> >\n>> > This test fails for me, probably because XDG_RUNTIME_DIR is not\n>> > exported.\n>> >\n>> > -Peff\n>>\n>> Could you please give a try to the patch set v2, test of which is\n>> definitely passed on my computer.\n>\n> Yes, that was what I tried earlier (and I just re-tested to make sure).\n> It still fails. I suspect it has to do with whether XDG_RUNTIME_DIR is\n> set in our environments (outside of the test suite). If I run:\n>\n>   XDG_RUNTIME_DIR=/tmp/foo ./t0301-credential-cache.sh\n>\n> it passes.\n>\n> -Peff\n\nSorry, I wrongly considered your comment is for my last commit. That\nwas partly because my thread is\ndisturbed by my commits in my mailbox(gmail). I hope that did not also\ndisturb yours.\n\nI sent my commits with `--thread` and `--no-chain-reply-to` in hope\nthat I would send an summary as\n[PATCH 0/x] and all my commits would be sent in reply to it. But I failed.\n"}]}