{"thread":{"id":"39912","subject":"[PATCH] contrib/subtree: ignore log.date configuration","startedAt":"2015-07-21T23:59:12Z","lastAt":"2015-07-21T23:59:12Z","messageCount":1,"participants":["David Aguilar"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"266598","messageId":"1437523152-28911-1-git-send-email-davvid@gmail.com","threadId":"39912","inReplyTo":null,"subject":"[PATCH] contrib/subtree: ignore log.date configuration","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2015-07-21T23:59:12Z","receivedAt":"2015-07-21T23:59:12Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"git-subtree's log format string uses \"%ad\" and \"%cd\", which\nrespect the user's configured log.date value.\n\nThis is problematic for git-subtree because it needs to use real\ndates so that copied commits come through unchanged.\n\nAdd a test and tweak the format strings to use %aD and %cD\nso that the default date format is used instead.\n\nReported-by: Bryan Jacobs <b@q3q.us>\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n contrib/subtree/git-subtree.sh     | 2 +-\n contrib/subtree/t/t7900-subtree.sh | 5 +++++\n 2 files changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 07bd77c..9f06571 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -305,7 +305,7 @@ copy_commit()\n \t# We're going to set some environment vars here, so\n \t# do it in a subshell to get rid of them safely later\n \tdebug copy_commit \"{$1}\" \"{$2}\" \"{$3}\"\n-\tgit log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%B' \"$1\" |\n+\tgit log -1 --pretty=format:'%an%n%ae%n%aD%n%cn%n%ce%n%cD%n%B' \"$1\" |\n \t(\n \t\tread GIT_AUTHOR_NAME\n \t\tread GIT_AUTHOR_EMAIL\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex bd3df97..cd2dfe7 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -94,6 +94,11 @@ test_expect_success 'add sub3' '\n # Back to mainline\n cd ..\n \n+# Enable log.date=relative to catch errors\n+test_expect_success 'enable log.date=relative to catch error' '\n+\tgit config log.date relative\n+'\n+\n test_expect_success 'add main4' '\n \tcreate main4 &&\n \tgit commit -m \"main4\" &&\n-- \n2.5.0.rc3\n"}]}