Merge branch 'da/subtree-date-confusion' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 19 Aug 2015 21:41:24 +0000 (14:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Aug 2015 21:41:25 +0000 (14:41 -0700)
"git subtree" (in contrib/) depended on "git log" output to be
stable, which was a no-no. Apply a workaround to force a
particular date format.

* da/subtree-date-confusion:
contrib/subtree: ignore log.date configuration

contrib/subtree/git-subtree.sh
contrib/subtree/t/t7900-subtree.sh
index 07bd77c4c8c63cff3ecac05f9ce922fda5fddf67..9f065718513c5c1e82d355aa9dab40ee421b765e 100755 (executable)
@@ -305,7 +305,7 @@ copy_commit()
        # We're going to set some environment vars here, so
        # do it in a subshell to get rid of them safely later
        debug copy_commit "{$1}" "{$2}" "{$3}"
-       git log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%B' "$1" |
+       git log -1 --pretty=format:'%an%n%ae%n%aD%n%cn%n%ce%n%cD%n%B' "$1" |
        (
                read GIT_AUTHOR_NAME
                read GIT_AUTHOR_EMAIL
index bd3df97936eb77e39642ec917a8d3366945fb0a8..90519823be381390b7f89a1eb2f6007f1e8c86f4 100755 (executable)
@@ -94,6 +94,10 @@ test_expect_success 'add sub3' '
 # Back to mainline
 cd ..
 
+test_expect_success 'enable log.date=relative to catch errors' '
+       git config log.date relative
+'
+
 test_expect_success 'add main4' '
        create main4 &&
        git commit -m "main4" &&