{"thread":{"id":"34248","subject":"[PATCH 0/5] \"log --author-date-order\" follow-up","startedAt":"2013-06-21T18:49:34Z","lastAt":"2013-06-21T18:49:39Z","messageCount":6,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"221626","messageId":"1371840579-20161-1-git-send-email-gitster@pobox.com","threadId":"34248","inReplyTo":null,"subject":"[PATCH 0/5] \"log --author-date-order\" follow-up","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-21T18:49:34Z","receivedAt":"2013-06-21T18:49:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Complete the series to teach \"--author-date-order\" to the commands\nin the log family by adding some tests.\n\nWe did not have explicit tests for --date-order, so the third patch\nin this series adds one while at it.\n\nJunio C Hamano (5):\n  t/lib-t6000: style fixes\n  topology tests: teach a helper to take abbreviated timestamps\n  t6003: add --date-order test\n  topology tests: teach a helper to set author dates as well\n  t6003: add --author-date-order test\n\n t/lib-t6000.sh                 | 104 ++++++++++++++++++++++-------------------\n t/t6002-rev-list-bisect.sh     |  84 ++++++++++++++++-----------------\n t/t6003-rev-list-topo-order.sh | 101 +++++++++++++++++++++++++++------------\n 3 files changed, 169 insertions(+), 120 deletions(-)\n\n-- \n1.8.3.1-682-g924db96\n"},{"id":"221630","messageId":"1371840579-20161-2-git-send-email-gitster@pobox.com","threadId":"34248","inReplyTo":"1371840579-20161-1-git-send-email-gitster@pobox.com","subject":"[PATCH 1/5] t/lib-t6000: style fixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-21T18:49:35Z","receivedAt":"2013-06-21T18:49:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mostly fixes to initial indentation with 8-SP (they should be HT)\nand wrapping long lines.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/lib-t6000.sh | 87 +++++++++++++++++++++++++++-------------------------------\n 1 file changed, 40 insertions(+), 47 deletions(-)\n\ndiff --git a/t/lib-t6000.sh b/t/lib-t6000.sh\nindex ea25dd8..102d567 100644\n--- a/t/lib-t6000.sh\n+++ b/t/lib-t6000.sh\n@@ -1,55 +1,50 @@\n : included from 6002 and others\n \n-[ -d .git/refs/tags ] || mkdir -p .git/refs/tags\n+mkdir -p .git/refs/tags\n \n-:> sed.script\n+>sed.script\n \n-# Answer the sha1 has associated with the tag. The tag must exist in .git or .git/refs/tags\n-tag()\n-{\n+# Answer the sha1 has associated with the tag. The tag must exist in .git/refs/tags\n+tag () {\n \t_tag=$1\n-\t[ -f .git/refs/tags/$_tag ] || error \"tag: \\\"$_tag\\\" does not exist\"\n-\tcat .git/refs/tags/$_tag\n+\ttest -f \".git/refs/tags/$_tag\" || error \"tag: \\\"$_tag\\\" does not exist\"\n+\tcat \".git/refs/tags/$_tag\"\n }\n \n # Generate a commit using the text specified to make it unique and the tree\n # named by the tag specified.\n-unique_commit()\n-{\n+unique_commit () {\n \t_text=$1\n-        _tree=$2\n+\t_tree=$2\n \tshift 2\n-\techo $_text | git commit-tree $(tag $_tree) \"$@\"\n+\techo \"$_text\" | git commit-tree $(tag \"$_tree\") \"$@\"\n }\n \n # Save the output of a command into the tag specified. Prepend\n # a substitution script for the tag onto the front of sed.script\n-save_tag()\n-{\n+save_tag () {\n \t_tag=$1\n-\t[ -n \"$_tag\" ] || error \"usage: save_tag tag commit-args ...\"\n+\ttest -n \"$_tag\" || error \"usage: save_tag tag commit-args ...\"\n \tshift 1\n-\t\"$@\" >.git/refs/tags/$_tag\n+\t\"$@\" >\".git/refs/tags/$_tag\"\n \n-        echo \"s/$(tag $_tag)/$_tag/g\" > sed.script.tmp\n-\tcat sed.script >> sed.script.tmp\n+\techo \"s/$(tag $_tag)/$_tag/g\" >sed.script.tmp\n+\tcat sed.script >>sed.script.tmp\n \trm sed.script\n \tmv sed.script.tmp sed.script\n }\n \n # Replace unhelpful sha1 hashses with their symbolic equivalents\n-entag()\n-{\n+entag () {\n \tsed -f sed.script\n }\n \n # Execute a command after first saving, then setting the GIT_AUTHOR_EMAIL\n # tag to a specified value. Restore the original value on return.\n-as_author()\n-{\n+as_author () {\n \t_author=$1\n \tshift 1\n-        _save=$GIT_AUTHOR_EMAIL\n+\t_save=$GIT_AUTHOR_EMAIL\n \n \tGIT_AUTHOR_EMAIL=\"$_author\"\n \texport GIT_AUTHOR_EMAIL\n@@ -63,45 +58,41 @@ as_author()\n \tfi\n }\n \n-commit_date()\n-{\n-        _commit=$1\n-\tgit cat-file commit $_commit | sed -n \"s/^committer .*> \\([0-9]*\\) .*/\\1/p\"\n+commit_date () {\n+\t_commit=$1\n+\tgit cat-file commit $_commit |\n+\tsed -n \"s/^committer .*> \\([0-9]*\\) .*/\\1/p\"\n }\n \n-on_committer_date()\n-{\n-    _date=$1\n-    shift 1\n-    GIT_COMMITTER_DATE=\"$_date\"\n-    export GIT_COMMITTER_DATE\n-    \"$@\"\n-    unset GIT_COMMITTER_DATE\n+on_committer_date () {\n+\t_date=$1\n+\tshift 1\n+\tGIT_COMMITTER_DATE=\"$_date\"\n+\texport GIT_COMMITTER_DATE\n+\t\"$@\"\n+\tunset GIT_COMMITTER_DATE\n }\n \n # Execute a command and suppress any error output.\n-hide_error()\n-{\n+hide_error () {\n \t\"$@\" 2>/dev/null\n }\n \n-check_output()\n-{\n+check_output () {\n \t_name=$1\n \tshift 1\n-\tif eval \"$*\" | entag > $_name.actual\n+\tif eval \"$*\" | entag >\"$_name.actual\"\n \tthen\n-\t\ttest_cmp $_name.expected $_name.actual\n+\t\ttest_cmp \"$_name.expected\" \"$_name.actual\"\n \telse\n-\t\treturn 1;\n+\t\treturn 1\n \tfi\n }\n \n # Turn a reasonable test description into a reasonable test name.\n # All alphanums translated into -'s which are then compressed and stripped\n # from front and back.\n-name_from_description()\n-{\n+name_from_description () {\n \tperl -pe '\n \t\ts/[^A-Za-z0-9.]/-/g;\n \t\ts/-+/-/g;\n@@ -119,9 +110,11 @@ name_from_description()\n test_output_expect_success()\n {\n \t_description=$1\n-        _test=$2\n-        [ $# -eq 2 ] || error \"usage: test_output_expect_success description test <<EOF ... EOF\"\n-        _name=$(echo $_description | name_from_description)\n-\tcat > $_name.expected\n+\t_test=$2\n+\ttest $# -eq 2 ||\n+\terror \"usage: test_output_expect_success description test <<EOF ... EOF\"\n+\n+\t_name=$(echo $_description | name_from_description)\n+\tcat >\"$_name.expected\"\n \ttest_expect_success \"$_description\" \"check_output $_name \\\"$_test\\\"\"\n }\n-- \n1.8.3.1-682-g924db96\n"},{"id":"221627","messageId":"1371840579-20161-3-git-send-email-gitster@pobox.com","threadId":"34248","inReplyTo":"1371840579-20161-1-git-send-email-gitster@pobox.com","subject":"[PATCH 2/5] topology tests: teach a helper to take abbreviated timestamps","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-21T18:49:36Z","receivedAt":"2013-06-21T18:49:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The on_committer_date helper in t/lib-t6000 is used in t6002 and\nt6003 with timestamps on a single day within a single minute\n(i.e. 1971-08-16 00:00) and the tests repeat this over and over.\n\nThe actual value of the timestamp, however, does not matter very\nmuch; only their relative ordering does.\n\nIntroduce another helper to expand only the suffix of the timestamp\nto a full timestamp to make the lines shorter, and use it in this\nhelper.  Also, because all the commits in the test are made with\nspecific GIT_COMMITTER_DATE, stop unsetting it at the end of the\nhelper.\n\nWe'll be specifying the author timestamp to these test commits in a\nlater patch, which will be helped with this change.\n\nAlso remove a test that was commented-out from t6003; it used to\ntest a commit with the same parent listed twice, which was allowed\nby mistake but was fixed long time ago.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/lib-t6000.sh                 | 17 +++++++--\n t/t6002-rev-list-bisect.sh     | 84 +++++++++++++++++++++---------------------\n t/t6003-rev-list-topo-order.sh | 57 +++++++++++++---------------\n 3 files changed, 81 insertions(+), 77 deletions(-)\n\ndiff --git a/t/lib-t6000.sh b/t/lib-t6000.sh\nindex 102d567..e2c3615 100644\n--- a/t/lib-t6000.sh\n+++ b/t/lib-t6000.sh\n@@ -64,13 +64,22 @@ commit_date () {\n \tsed -n \"s/^committer .*> \\([0-9]*\\) .*/\\1/p\"\n }\n \n+# Assign the value of fake date to a variable, but\n+# allow fairly common \"1971-08-16 00:00\" to be omittd\n+assign_fake_date () {\n+\tcase \"$2\" in\n+\t??:??:??)\teval \"$1='1971-08-16 $2'\" ;;\n+\t??:??)\t\teval \"$1='1971-08-16 00:$2'\" ;;\n+\t??)\t\teval \"$1='1971-08-16 00:00:$2'\" ;;\n+\t*)\t\teval \"$1='$2'\" ;;\n+\tesac\n+}\n+\n on_committer_date () {\n-\t_date=$1\n-\tshift 1\n-\tGIT_COMMITTER_DATE=\"$_date\"\n+\tassign_fake_date GIT_COMMITTER_DATE \"$1\"\n \texport GIT_COMMITTER_DATE\n+\tshift 1\n \t\"$@\"\n-\tunset GIT_COMMITTER_DATE\n }\n \n # Execute a command and suppress any error output.\ndiff --git a/t/t6002-rev-list-bisect.sh b/t/t6002-rev-list-bisect.sh\nindex fb07536..43ad772 100755\n--- a/t/t6002-rev-list-bisect.sh\n+++ b/t/t6002-rev-list-bisect.sh\n@@ -39,25 +39,25 @@ test_bisection_diff()\n date >path0\n git update-index --add path0\n save_tag tree git write-tree\n-on_committer_date \"1971-08-16 00:00:00\" hide_error save_tag root unique_commit root tree\n-on_committer_date \"1971-08-16 00:00:01\" save_tag l0 unique_commit l0 tree -p root\n-on_committer_date \"1971-08-16 00:00:02\" save_tag l1 unique_commit l1 tree -p l0\n-on_committer_date \"1971-08-16 00:00:03\" save_tag l2 unique_commit l2 tree -p l1\n-on_committer_date \"1971-08-16 00:00:04\" save_tag a0 unique_commit a0 tree -p l2\n-on_committer_date \"1971-08-16 00:00:05\" save_tag a1 unique_commit a1 tree -p a0\n-on_committer_date \"1971-08-16 00:00:06\" save_tag b1 unique_commit b1 tree -p a0\n-on_committer_date \"1971-08-16 00:00:07\" save_tag c1 unique_commit c1 tree -p b1\n-on_committer_date \"1971-08-16 00:00:08\" save_tag b2 unique_commit b2 tree -p b1\n-on_committer_date \"1971-08-16 00:00:09\" save_tag b3 unique_commit b2 tree -p b2\n-on_committer_date \"1971-08-16 00:00:10\" save_tag c2 unique_commit c2 tree -p c1 -p b2\n-on_committer_date \"1971-08-16 00:00:11\" save_tag c3 unique_commit c3 tree -p c2\n-on_committer_date \"1971-08-16 00:00:12\" save_tag a2 unique_commit a2 tree -p a1\n-on_committer_date \"1971-08-16 00:00:13\" save_tag a3 unique_commit a3 tree -p a2\n-on_committer_date \"1971-08-16 00:00:14\" save_tag b4 unique_commit b4 tree -p b3 -p a3\n-on_committer_date \"1971-08-16 00:00:15\" save_tag a4 unique_commit a4 tree -p a3 -p b4 -p c3\n-on_committer_date \"1971-08-16 00:00:16\" save_tag l3 unique_commit l3 tree -p a4\n-on_committer_date \"1971-08-16 00:00:17\" save_tag l4 unique_commit l4 tree -p l3\n-on_committer_date \"1971-08-16 00:00:18\" save_tag l5 unique_commit l5 tree -p l4\n+on_committer_date \"00:00\" hide_error save_tag root unique_commit root tree\n+on_committer_date \"00:01\" save_tag l0 unique_commit l0 tree -p root\n+on_committer_date \"00:02\" save_tag l1 unique_commit l1 tree -p l0\n+on_committer_date \"00:03\" save_tag l2 unique_commit l2 tree -p l1\n+on_committer_date \"00:04\" save_tag a0 unique_commit a0 tree -p l2\n+on_committer_date \"00:05\" save_tag a1 unique_commit a1 tree -p a0\n+on_committer_date \"00:06\" save_tag b1 unique_commit b1 tree -p a0\n+on_committer_date \"00:07\" save_tag c1 unique_commit c1 tree -p b1\n+on_committer_date \"00:08\" save_tag b2 unique_commit b2 tree -p b1\n+on_committer_date \"00:09\" save_tag b3 unique_commit b2 tree -p b2\n+on_committer_date \"00:10\" save_tag c2 unique_commit c2 tree -p c1 -p b2\n+on_committer_date \"00:11\" save_tag c3 unique_commit c3 tree -p c2\n+on_committer_date \"00:12\" save_tag a2 unique_commit a2 tree -p a1\n+on_committer_date \"00:13\" save_tag a3 unique_commit a3 tree -p a2\n+on_committer_date \"00:14\" save_tag b4 unique_commit b4 tree -p b3 -p a3\n+on_committer_date \"00:15\" save_tag a4 unique_commit a4 tree -p a3 -p b4 -p c3\n+on_committer_date \"00:16\" save_tag l3 unique_commit l3 tree -p a4\n+on_committer_date \"00:17\" save_tag l4 unique_commit l4 tree -p l3\n+on_committer_date \"00:18\" save_tag l5 unique_commit l5 tree -p l4\n git update-ref HEAD $(tag l5)\n \n \n@@ -90,29 +90,29 @@ git update-ref HEAD $(tag l5)\n #     F\n \n \n-on_committer_date \"1971-08-16 00:00:00\" hide_error save_tag F unique_commit F tree\n-on_committer_date \"1971-08-16 00:00:01\" save_tag e8 unique_commit e8 tree -p F\n-on_committer_date \"1971-08-16 00:00:02\" save_tag e7 unique_commit e7 tree -p e8\n-on_committer_date \"1971-08-16 00:00:03\" save_tag e6 unique_commit e6 tree -p e7\n-on_committer_date \"1971-08-16 00:00:04\" save_tag e5 unique_commit e5 tree -p e6\n-on_committer_date \"1971-08-16 00:00:05\" save_tag f4 unique_commit f4 tree -p F\n-on_committer_date \"1971-08-16 00:00:06\" save_tag f3 unique_commit f3 tree -p f4\n-on_committer_date \"1971-08-16 00:00:07\" save_tag f2 unique_commit f2 tree -p f3\n-on_committer_date \"1971-08-16 00:00:08\" save_tag f1 unique_commit f1 tree -p f2\n-on_committer_date \"1971-08-16 00:00:09\" save_tag e4 unique_commit e4 tree -p e5\n-on_committer_date \"1971-08-16 00:00:10\" save_tag e3 unique_commit e3 tree -p e4\n-on_committer_date \"1971-08-16 00:00:11\" save_tag e2 unique_commit e2 tree -p e3\n-on_committer_date \"1971-08-16 00:00:12\" save_tag e1 unique_commit e1 tree -p e2\n-on_committer_date \"1971-08-16 00:00:13\" save_tag E unique_commit E tree -p e1 -p f1\n-\n-on_committer_date \"1971-08-16 00:00:00\" hide_error save_tag U unique_commit U tree\n-on_committer_date \"1971-08-16 00:00:01\" save_tag u0 unique_commit u0 tree -p U\n-on_committer_date \"1971-08-16 00:00:01\" save_tag u1 unique_commit u1 tree -p u0\n-on_committer_date \"1971-08-16 00:00:02\" save_tag u2 unique_commit u2 tree -p u0\n-on_committer_date \"1971-08-16 00:00:03\" save_tag u3 unique_commit u3 tree -p u0\n-on_committer_date \"1971-08-16 00:00:04\" save_tag u4 unique_commit u4 tree -p u0\n-on_committer_date \"1971-08-16 00:00:05\" save_tag u5 unique_commit u5 tree -p u0\n-on_committer_date \"1971-08-16 00:00:06\" save_tag V unique_commit V tree -p u1 -p u2 -p u3 -p u4 -p u5\n+on_committer_date \"00:00\" hide_error save_tag F unique_commit F tree\n+on_committer_date \"00:01\" save_tag e8 unique_commit e8 tree -p F\n+on_committer_date \"00:02\" save_tag e7 unique_commit e7 tree -p e8\n+on_committer_date \"00:03\" save_tag e6 unique_commit e6 tree -p e7\n+on_committer_date \"00:04\" save_tag e5 unique_commit e5 tree -p e6\n+on_committer_date \"00:05\" save_tag f4 unique_commit f4 tree -p F\n+on_committer_date \"00:06\" save_tag f3 unique_commit f3 tree -p f4\n+on_committer_date \"00:07\" save_tag f2 unique_commit f2 tree -p f3\n+on_committer_date \"00:08\" save_tag f1 unique_commit f1 tree -p f2\n+on_committer_date \"00:09\" save_tag e4 unique_commit e4 tree -p e5\n+on_committer_date \"00:10\" save_tag e3 unique_commit e3 tree -p e4\n+on_committer_date \"00:11\" save_tag e2 unique_commit e2 tree -p e3\n+on_committer_date \"00:12\" save_tag e1 unique_commit e1 tree -p e2\n+on_committer_date \"00:13\" save_tag E unique_commit E tree -p e1 -p f1\n+\n+on_committer_date \"00:00\" hide_error save_tag U unique_commit U tree\n+on_committer_date \"00:01\" save_tag u0 unique_commit u0 tree -p U\n+on_committer_date \"00:01\" save_tag u1 unique_commit u1 tree -p u0\n+on_committer_date \"00:02\" save_tag u2 unique_commit u2 tree -p u0\n+on_committer_date \"00:03\" save_tag u3 unique_commit u3 tree -p u0\n+on_committer_date \"00:04\" save_tag u4 unique_commit u4 tree -p u0\n+on_committer_date \"00:05\" save_tag u5 unique_commit u5 tree -p u0\n+on_committer_date \"00:06\" save_tag V unique_commit V tree -p u1 -p u2 -p u3 -p u4 -p u5\n \n test_sequence()\n {\ndiff --git a/t/t6003-rev-list-topo-order.sh b/t/t6003-rev-list-topo-order.sh\nindex e4c52b0..bb66b8b 100755\n--- a/t/t6003-rev-list-topo-order.sh\n+++ b/t/t6003-rev-list-topo-order.sh\n@@ -16,39 +16,34 @@ list_duplicates()\n date >path0\n git update-index --add path0\n save_tag tree git write-tree\n-on_committer_date \"1971-08-16 00:00:00\" hide_error save_tag root unique_commit root tree\n-on_committer_date \"1971-08-16 00:00:01\" save_tag l0 unique_commit l0 tree -p root\n-on_committer_date \"1971-08-16 00:00:02\" save_tag l1 unique_commit l1 tree -p l0\n-on_committer_date \"1971-08-16 00:00:03\" save_tag l2 unique_commit l2 tree -p l1\n-on_committer_date \"1971-08-16 00:00:04\" save_tag a0 unique_commit a0 tree -p l2\n-on_committer_date \"1971-08-16 00:00:05\" save_tag a1 unique_commit a1 tree -p a0\n-on_committer_date \"1971-08-16 00:00:06\" save_tag b1 unique_commit b1 tree -p a0\n-on_committer_date \"1971-08-16 00:00:07\" save_tag c1 unique_commit c1 tree -p b1\n-on_committer_date \"1971-08-16 00:00:08\" as_author foobar@example.com save_tag b2 unique_commit b2 tree -p b1\n-on_committer_date \"1971-08-16 00:00:09\" save_tag b3 unique_commit b3 tree -p b2\n-on_committer_date \"1971-08-16 00:00:10\" save_tag c2 unique_commit c2 tree -p c1 -p b2\n-on_committer_date \"1971-08-16 00:00:11\" save_tag c3 unique_commit c3 tree -p c2\n-on_committer_date \"1971-08-16 00:00:12\" save_tag a2 unique_commit a2 tree -p a1\n-on_committer_date \"1971-08-16 00:00:13\" save_tag a3 unique_commit a3 tree -p a2\n-on_committer_date \"1971-08-16 00:00:14\" save_tag b4 unique_commit b4 tree -p b3 -p a3\n-on_committer_date \"1971-08-16 00:00:15\" save_tag a4 unique_commit a4 tree -p a3 -p b4 -p c3\n-on_committer_date \"1971-08-16 00:00:16\" save_tag l3 unique_commit l3 tree -p a4\n-on_committer_date \"1971-08-16 00:00:17\" save_tag l4 unique_commit l4 tree -p l3\n-on_committer_date \"1971-08-16 00:00:18\" save_tag l5 unique_commit l5 tree -p l4\n-on_committer_date \"1971-08-16 00:00:19\" save_tag m1 unique_commit m1 tree -p a4 -p c3\n-on_committer_date \"1971-08-16 00:00:20\" save_tag m2 unique_commit m2 tree -p c3 -p a4\n-on_committer_date \"1971-08-16 00:00:21\" hide_error save_tag alt_root unique_commit alt_root tree\n-on_committer_date \"1971-08-16 00:00:22\" save_tag r0 unique_commit r0 tree -p alt_root\n-on_committer_date \"1971-08-16 00:00:23\" save_tag r1 unique_commit r1 tree -p r0\n-on_committer_date \"1971-08-16 00:00:24\" save_tag l5r1 unique_commit l5r1 tree -p l5 -p r1\n-on_committer_date \"1971-08-16 00:00:25\" save_tag r1l5 unique_commit r1l5 tree -p r1 -p l5\n+on_committer_date \"00:00\" hide_error save_tag root unique_commit root tree\n+on_committer_date \"00:01\" save_tag l0 unique_commit l0 tree -p root\n+on_committer_date \"00:02\" save_tag l1 unique_commit l1 tree -p l0\n+on_committer_date \"00:03\" save_tag l2 unique_commit l2 tree -p l1\n+on_committer_date \"00:04\" save_tag a0 unique_commit a0 tree -p l2\n+on_committer_date \"00:05\" save_tag a1 unique_commit a1 tree -p a0\n+on_committer_date \"00:06\" save_tag b1 unique_commit b1 tree -p a0\n+on_committer_date \"00:07\" save_tag c1 unique_commit c1 tree -p b1\n+on_committer_date \"00:08\" as_author foobar@example.com save_tag b2 unique_commit b2 tree -p b1\n+on_committer_date \"00:09\" save_tag b3 unique_commit b3 tree -p b2\n+on_committer_date \"00:10\" save_tag c2 unique_commit c2 tree -p c1 -p b2\n+on_committer_date \"00:11\" save_tag c3 unique_commit c3 tree -p c2\n+on_committer_date \"00:12\" save_tag a2 unique_commit a2 tree -p a1\n+on_committer_date \"00:13\" save_tag a3 unique_commit a3 tree -p a2\n+on_committer_date \"00:14\" save_tag b4 unique_commit b4 tree -p b3 -p a3\n+on_committer_date \"00:15\" save_tag a4 unique_commit a4 tree -p a3 -p b4 -p c3\n+on_committer_date \"00:16\" save_tag l3 unique_commit l3 tree -p a4\n+on_committer_date \"00:17\" save_tag l4 unique_commit l4 tree -p l3\n+on_committer_date \"00:18\" save_tag l5 unique_commit l5 tree -p l4\n+on_committer_date \"00:19\" save_tag m1 unique_commit m1 tree -p a4 -p c3\n+on_committer_date \"00:20\" save_tag m2 unique_commit m2 tree -p c3 -p a4\n+on_committer_date \"00:21\" hide_error save_tag alt_root unique_commit alt_root tree\n+on_committer_date \"00:22\" save_tag r0 unique_commit r0 tree -p alt_root\n+on_committer_date \"00:23\" save_tag r1 unique_commit r1 tree -p r0\n+on_committer_date \"00:24\" save_tag l5r1 unique_commit l5r1 tree -p l5 -p r1\n+on_committer_date \"00:25\" save_tag r1l5 unique_commit r1l5 tree -p r1 -p l5\n \n \n-#\n-# note: as of 20/6, it isn't possible to create duplicate parents, so this\n-# can't be tested.\n-#\n-#on_committer_date \"1971-08-16 00:00:20\" save_tag m3 unique_commit m3 tree -p c3 -p a4 -p c3\n hide_error save_tag e1 as_author e@example.com unique_commit e1 tree\n save_tag e2 as_author e@example.com unique_commit e2 tree -p e1\n save_tag f1 as_author f@example.com unique_commit f1 tree -p e1\n-- \n1.8.3.1-682-g924db96\n"},{"id":"221631","messageId":"1371840579-20161-4-git-send-email-gitster@pobox.com","threadId":"34248","inReplyTo":"1371840579-20161-1-git-send-email-gitster@pobox.com","subject":"[PATCH 3/5] t6003: add --date-order test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-21T18:49:37Z","receivedAt":"2013-06-21T18:49:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The \"--date-order\" output is a slight twist of \"--topo-order\" in\nthat commits from parallel histories are shown in their committer\ndate order without an attempt to clump commits from a single line\nof history together like --topo-order does.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t6003-rev-list-topo-order.sh | 22 ++++++++++++++++++++++\n 1 file changed, 22 insertions(+)\n\ndiff --git a/t/t6003-rev-list-topo-order.sh b/t/t6003-rev-list-topo-order.sh\nindex bb66b8b..0e3b7e1 100755\n--- a/t/t6003-rev-list-topo-order.sh\n+++ b/t/t6003-rev-list-topo-order.sh\n@@ -100,6 +100,28 @@ l0\n root\n EOF\n \n+test_output_expect_success 'simple date order' 'git rev-list --date-order  HEAD' <<EOF\n+l5\n+l4\n+l3\n+a4\n+b4\n+a3\n+a2\n+c3\n+c2\n+b3\n+b2\n+c1\n+b1\n+a1\n+a0\n+l2\n+l1\n+l0\n+root\n+EOF\n+\n test_output_expect_success 'two diamonds topo order (g6)' 'git rev-list --topo-order  g4' <<EOF\n g4\n h2\n-- \n1.8.3.1-682-g924db96\n"},{"id":"221628","messageId":"1371840579-20161-5-git-send-email-gitster@pobox.com","threadId":"34248","inReplyTo":"1371840579-20161-1-git-send-email-gitster@pobox.com","subject":"[PATCH 4/5] topology tests: teach a helper to set author dates as well","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-21T18:49:38Z","receivedAt":"2013-06-21T18:49:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Introduce on_dates helper that is similar to on_committer_date but\nalso sets the author date, not just the committer date.\n\nAt this step, just set the same timestamp to the author date as the\ncommitter date, as no test looks at author date yet.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/lib-t6000.sh                 |  8 +++++++\n t/t6003-rev-list-topo-order.sh | 52 +++++++++++++++++++++---------------------\n 2 files changed, 34 insertions(+), 26 deletions(-)\n\ndiff --git a/t/lib-t6000.sh b/t/lib-t6000.sh\nindex e2c3615..4ffd901 100644\n--- a/t/lib-t6000.sh\n+++ b/t/lib-t6000.sh\n@@ -82,6 +82,14 @@ on_committer_date () {\n \t\"$@\"\n }\n \n+on_dates () {\n+\tassign_fake_date GIT_COMMITTER_DATE \"$1\"\n+\tassign_fake_date GIT_AUTHOR_DATE \"$2\"\n+\texport GIT_COMMITTER_DATE GIT_AUTHOR_DATE\n+\tshift 2\n+\t\"$@\"\n+}\n+\n # Execute a command and suppress any error output.\n hide_error () {\n \t\"$@\" 2>/dev/null\ndiff --git a/t/t6003-rev-list-topo-order.sh b/t/t6003-rev-list-topo-order.sh\nindex 0e3b7e1..77bf2ca 100755\n--- a/t/t6003-rev-list-topo-order.sh\n+++ b/t/t6003-rev-list-topo-order.sh\n@@ -16,32 +16,32 @@ list_duplicates()\n date >path0\n git update-index --add path0\n save_tag tree git write-tree\n-on_committer_date \"00:00\" hide_error save_tag root unique_commit root tree\n-on_committer_date \"00:01\" save_tag l0 unique_commit l0 tree -p root\n-on_committer_date \"00:02\" save_tag l1 unique_commit l1 tree -p l0\n-on_committer_date \"00:03\" save_tag l2 unique_commit l2 tree -p l1\n-on_committer_date \"00:04\" save_tag a0 unique_commit a0 tree -p l2\n-on_committer_date \"00:05\" save_tag a1 unique_commit a1 tree -p a0\n-on_committer_date \"00:06\" save_tag b1 unique_commit b1 tree -p a0\n-on_committer_date \"00:07\" save_tag c1 unique_commit c1 tree -p b1\n-on_committer_date \"00:08\" as_author foobar@example.com save_tag b2 unique_commit b2 tree -p b1\n-on_committer_date \"00:09\" save_tag b3 unique_commit b3 tree -p b2\n-on_committer_date \"00:10\" save_tag c2 unique_commit c2 tree -p c1 -p b2\n-on_committer_date \"00:11\" save_tag c3 unique_commit c3 tree -p c2\n-on_committer_date \"00:12\" save_tag a2 unique_commit a2 tree -p a1\n-on_committer_date \"00:13\" save_tag a3 unique_commit a3 tree -p a2\n-on_committer_date \"00:14\" save_tag b4 unique_commit b4 tree -p b3 -p a3\n-on_committer_date \"00:15\" save_tag a4 unique_commit a4 tree -p a3 -p b4 -p c3\n-on_committer_date \"00:16\" save_tag l3 unique_commit l3 tree -p a4\n-on_committer_date \"00:17\" save_tag l4 unique_commit l4 tree -p l3\n-on_committer_date \"00:18\" save_tag l5 unique_commit l5 tree -p l4\n-on_committer_date \"00:19\" save_tag m1 unique_commit m1 tree -p a4 -p c3\n-on_committer_date \"00:20\" save_tag m2 unique_commit m2 tree -p c3 -p a4\n-on_committer_date \"00:21\" hide_error save_tag alt_root unique_commit alt_root tree\n-on_committer_date \"00:22\" save_tag r0 unique_commit r0 tree -p alt_root\n-on_committer_date \"00:23\" save_tag r1 unique_commit r1 tree -p r0\n-on_committer_date \"00:24\" save_tag l5r1 unique_commit l5r1 tree -p l5 -p r1\n-on_committer_date \"00:25\" save_tag r1l5 unique_commit r1l5 tree -p r1 -p l5\n+on_dates \"00:00\" \"00:00\" hide_error save_tag root unique_commit root tree\n+on_dates \"00:01\" \"00:01\" save_tag l0 unique_commit l0 tree -p root\n+on_dates \"00:02\" \"00:02\" save_tag l1 unique_commit l1 tree -p l0\n+on_dates \"00:03\" \"00:03\" save_tag l2 unique_commit l2 tree -p l1\n+on_dates \"00:04\" \"00:04\" save_tag a0 unique_commit a0 tree -p l2\n+on_dates \"00:05\" \"00:05\" save_tag a1 unique_commit a1 tree -p a0\n+on_dates \"00:06\" \"00:06\" save_tag b1 unique_commit b1 tree -p a0\n+on_dates \"00:07\" \"00:07\" save_tag c1 unique_commit c1 tree -p b1\n+on_dates \"00:08\" \"00:08\" as_author foobar@example.com save_tag b2 unique_commit b2 tree -p b1\n+on_dates \"00:09\" \"00:09\" save_tag b3 unique_commit b3 tree -p b2\n+on_dates \"00:10\" \"00:10\" save_tag c2 unique_commit c2 tree -p c1 -p b2\n+on_dates \"00:11\" \"00:11\" save_tag c3 unique_commit c3 tree -p c2\n+on_dates \"00:12\" \"00:12\" save_tag a2 unique_commit a2 tree -p a1\n+on_dates \"00:13\" \"00:13\" save_tag a3 unique_commit a3 tree -p a2\n+on_dates \"00:14\" \"00:14\" save_tag b4 unique_commit b4 tree -p b3 -p a3\n+on_dates \"00:15\" \"00:15\" save_tag a4 unique_commit a4 tree -p a3 -p b4 -p c3\n+on_dates \"00:16\" \"00:16\" save_tag l3 unique_commit l3 tree -p a4\n+on_dates \"00:17\" \"00:17\" save_tag l4 unique_commit l4 tree -p l3\n+on_dates \"00:18\" \"00:18\" save_tag l5 unique_commit l5 tree -p l4\n+on_dates \"00:19\" \"00:19\" save_tag m1 unique_commit m1 tree -p a4 -p c3\n+on_dates \"00:20\" \"00:20\" save_tag m2 unique_commit m2 tree -p c3 -p a4\n+on_dates \"00:21\" \"00:21\" hide_error save_tag alt_root unique_commit alt_root tree\n+on_dates \"00:22\" \"00:22\" save_tag r0 unique_commit r0 tree -p alt_root\n+on_dates \"00:23\" \"00:23\" save_tag r1 unique_commit r1 tree -p r0\n+on_dates \"00:24\" \"00:24\" save_tag l5r1 unique_commit l5r1 tree -p l5 -p r1\n+on_dates \"00:25\" \"00:25\" save_tag r1l5 unique_commit r1l5 tree -p r1 -p l5\n \n \n hide_error save_tag e1 as_author e@example.com unique_commit e1 tree\n-- \n1.8.3.1-682-g924db96\n"},{"id":"221629","messageId":"1371840579-20161-6-git-send-email-gitster@pobox.com","threadId":"34248","inReplyTo":"1371840579-20161-1-git-send-email-gitster@pobox.com","subject":"[PATCH 5/5] t6003: add --author-date-order test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-21T18:49:39Z","receivedAt":"2013-06-21T18:49:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tweak the --topo/date-order test vector a bit and mark the author\ndates of two commits (a2 and a3) earlier than their own committer\ndates, making them much older than other commits that are made on\nparallel branches to simulate the case where a long running topic\nwas rebased recently.\n\nThey will show up as recent in the --date-order output due to their\ntimestamps, but they appear a lot later in the --author-date-order\noutput, even though their committer timestamp says otherwise.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t6003-rev-list-topo-order.sh | 26 ++++++++++++++++++++++++--\n 1 file changed, 24 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t6003-rev-list-topo-order.sh b/t/t6003-rev-list-topo-order.sh\nindex 77bf2ca..24d1836 100755\n--- a/t/t6003-rev-list-topo-order.sh\n+++ b/t/t6003-rev-list-topo-order.sh\n@@ -28,8 +28,8 @@ on_dates \"00:08\" \"00:08\" as_author foobar@example.com save_tag b2 unique_commit\n on_dates \"00:09\" \"00:09\" save_tag b3 unique_commit b3 tree -p b2\n on_dates \"00:10\" \"00:10\" save_tag c2 unique_commit c2 tree -p c1 -p b2\n on_dates \"00:11\" \"00:11\" save_tag c3 unique_commit c3 tree -p c2\n-on_dates \"00:12\" \"00:12\" save_tag a2 unique_commit a2 tree -p a1\n-on_dates \"00:13\" \"00:13\" save_tag a3 unique_commit a3 tree -p a2\n+on_dates \"00:12\" \"00:00\" save_tag a2 unique_commit a2 tree -p a1\n+on_dates \"00:13\" \"00:01\" save_tag a3 unique_commit a3 tree -p a2\n on_dates \"00:14\" \"00:14\" save_tag b4 unique_commit b4 tree -p b3 -p a3\n on_dates \"00:15\" \"00:15\" save_tag a4 unique_commit a4 tree -p a3 -p b4 -p c3\n on_dates \"00:16\" \"00:16\" save_tag l3 unique_commit l3 tree -p a4\n@@ -122,6 +122,28 @@ l0\n root\n EOF\n \n+test_output_expect_success 'simple author-date order' 'git rev-list --author-date-order  HEAD' <<EOF\n+l5\n+l4\n+l3\n+a4\n+b4\n+c3\n+c2\n+b3\n+b2\n+c1\n+b1\n+a3\n+a2\n+a1\n+a0\n+l2\n+l1\n+l0\n+root\n+EOF\n+\n test_output_expect_success 'two diamonds topo order (g6)' 'git rev-list --topo-order  g4' <<EOF\n g4\n h2\n-- \n1.8.3.1-682-g924db96\n"}]}