{"thread":{"id":"39945","subject":"[PATCH] tests: Remove some direct access to .git/logs","startedAt":"2015-07-27T20:13:54Z","lastAt":"2015-07-27T22:56:05Z","messageCount":3,"participants":["David Turner","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"266860","messageId":"1438028034-23609-1-git-send-email-dturner@twopensource.com","threadId":"39945","inReplyTo":null,"subject":"[PATCH] tests: Remove some direct access to .git/logs","fromName":"David Turner","fromEmail":"dturner@twopensource.com","sentAt":"2015-07-27T20:13:54Z","receivedAt":"2015-07-27T20:13:54Z","isPatch":true,"sender":{"key":"novalis@novalis.org","avatar":"https://avatars.githubusercontent.com/u/77003?v=4"},"body":"Alternate refs backends might store reflogs somewhere other than\n.git/logs.  Change most test code that directly accesses .git/logs to\ninstead use git reflog commands.\n\nThere are still a few tests which need direct access to reflogs: to\ncheck reflog permissions, to manually create reflogs from scratch, to\nsave/restore reflogs, to check the format of raw reflog data, and to\nremove not just reflog contents, but the reflogs themselves. All cases\nwhich don't need direct access have been modified.\n\nSigned-off-by: David Turner <dturner@twopensource.com>\n---\n\nThis is a follow-up to the patch series that introduced --create-reflog\n\nMany tests need to be changed in order to pass under alternate refs\nbackends.  This particular set of issues happens to be easy to clean\nup, so I'm sending this patch now.\n\n---\n t/t1400-update-ref.sh         |  5 ++---\n t/t1410-reflog.sh             | 24 ++++++++++++++++--------\n t/t1411-reflog-show.sh        |  2 +-\n t/t1503-rev-parse-verify.sh   |  9 +++------\n t/t3200-branch.sh             | 12 ++++++------\n t/t3210-pack-refs.sh          |  2 +-\n t/t3404-rebase-interactive.sh | 10 +++++-----\n t/t3903-stash.sh              |  2 +-\n t/t5312-prune-corruption.sh   |  2 +-\n t/t6501-freshen-objects.sh    |  2 +-\n t/t7509-commit.sh             | 13 -------------\n 11 files changed, 37 insertions(+), 46 deletions(-)\n\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex d787bf5..8bf1559 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -155,12 +155,11 @@ test_expect_success \"(not) changed .git/$m\" \"\n '\n rm -f .git/$m\n \n-: a repository with working tree always has reflog these days...\n-: >.git/logs/refs/heads/master\n+rm -f .git/logs/refs/heads/master\n test_expect_success \\\n \t\"create $m (logged by touch)\" \\\n \t'GIT_COMMITTER_DATE=\"2005-05-26 23:30\" \\\n-\t git update-ref HEAD '\"$A\"' -m \"Initial Creation\" &&\n+\t git update-ref --create-reflog HEAD '\"$A\"' -m \"Initial Creation\" &&\n \t test '\"$A\"' = $(cat .git/'\"$m\"')'\n test_expect_success \\\n \t\"update $m (logged by touch)\" \\\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 779d4e3..b79049f 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -100,7 +100,8 @@ test_expect_success setup '\n \n \tcheck_fsck &&\n \n-\ttest_line_count = 4 .git/logs/refs/heads/master\n+\tgit reflog refs/heads/master >output &&\n+\ttest_line_count = 4 output\n '\n \n test_expect_success rewind '\n@@ -116,7 +117,8 @@ test_expect_success rewind '\n \n \tcheck_have A B C D E F G H I J K L &&\n \n-\ttest_line_count = 5 .git/logs/refs/heads/master\n+\tgit reflog refs/heads/master >output &&\n+\ttest_line_count = 5 output\n '\n \n test_expect_success 'corrupt and check' '\n@@ -134,7 +136,8 @@ test_expect_success 'reflog expire --dry-run should not touch reflog' '\n \t\t--stale-fix \\\n \t\t--all &&\n \n-\ttest_line_count = 5 .git/logs/refs/heads/master &&\n+\tgit reflog refs/heads/master >output &&\n+\ttest_line_count = 5 output &&\n \n \tcheck_fsck \"missing blob $F\"\n '\n@@ -147,7 +150,8 @@ test_expect_success 'reflog expire' '\n \t\t--stale-fix \\\n \t\t--all &&\n \n-\ttest_line_count = 2 .git/logs/refs/heads/master &&\n+\tgit reflog refs/heads/master >output &&\n+\ttest_line_count = 2 output &&\n \n \tcheck_fsck \"dangling commit $K\"\n '\n@@ -213,7 +217,8 @@ test_expect_success 'delete' '\n test_expect_success 'rewind2' '\n \n \ttest_tick && git reset --hard HEAD~2 &&\n-\ttest_line_count = 4 .git/logs/refs/heads/master\n+\tgit reflog refs/heads/master >output &&\n+\ttest_line_count = 4 output\n '\n \n test_expect_success '--expire=never' '\n@@ -222,7 +227,8 @@ test_expect_success '--expire=never' '\n \t\t--expire=never \\\n \t\t--expire-unreachable=never \\\n \t\t--all &&\n-\ttest_line_count = 4 .git/logs/refs/heads/master\n+\tgit reflog refs/heads/master >output &&\n+\ttest_line_count = 4 output\n '\n \n test_expect_success 'gc.reflogexpire=never' '\n@@ -230,7 +236,8 @@ test_expect_success 'gc.reflogexpire=never' '\n \tgit config gc.reflogexpire never &&\n \tgit config gc.reflogexpireunreachable never &&\n \tgit reflog expire --verbose --all &&\n-\ttest_line_count = 4 .git/logs/refs/heads/master\n+\tgit reflog refs/heads/master >output &&\n+\ttest_line_count = 4 output\n '\n \n test_expect_success 'gc.reflogexpire=false' '\n@@ -238,7 +245,8 @@ test_expect_success 'gc.reflogexpire=false' '\n \tgit config gc.reflogexpire false &&\n \tgit config gc.reflogexpireunreachable false &&\n \tgit reflog expire --verbose --all &&\n-\ttest_line_count = 4 .git/logs/refs/heads/master &&\n+\tgit reflog refs/heads/master >output &&\n+\ttest_line_count = 4 output &&\n \n \tgit config --unset gc.reflogexpire &&\n \tgit config --unset gc.reflogexpireunreachable\ndiff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh\nindex 6f47c0d..d568b35 100755\n--- a/t/t1411-reflog-show.sh\n+++ b/t/t1411-reflog-show.sh\n@@ -138,7 +138,7 @@ test_expect_success '--date magic does not override explicit @{0} syntax' '\n : >expect\n test_expect_success 'empty reflog file' '\n \tgit branch empty &&\n-\t: >.git/logs/refs/heads/empty &&\n+\tgit reflog expire --expire=all refs/heads/empty &&\n \n \tgit log -g empty >actual &&\n \ttest_cmp expect actual\ndiff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh\nindex 823fe1d..ab27d0d 100755\n--- a/t/t1503-rev-parse-verify.sh\n+++ b/t/t1503-rev-parse-verify.sh\n@@ -85,8 +85,7 @@ test_expect_success 'fails silently when using -q' '\n \n test_expect_success 'fails silently when using -q with deleted reflogs' '\n \tref=$(git rev-parse HEAD) &&\n-\t: >.git/logs/refs/test &&\n-\tgit update-ref -m \"message for refs/test\" refs/test \"$ref\" &&\n+\tgit update-ref --create-reflog -m \"message for refs/test\" refs/test \"$ref\" &&\n \tgit reflog delete --updateref --rewrite refs/test@{0} &&\n \ttest_must_fail git rev-parse -q --verify refs/test@{0} >error 2>&1 &&\n \ttest_must_be_empty error\n@@ -94,16 +93,14 @@ test_expect_success 'fails silently when using -q with deleted reflogs' '\n \n test_expect_success 'fails silently when using -q with not enough reflogs' '\n \tref=$(git rev-parse HEAD) &&\n-\t: >.git/logs/refs/test2 &&\n-\tgit update-ref -m \"message for refs/test2\" refs/test2 \"$ref\" &&\n+\tgit update-ref --create-reflog -m \"message for refs/test2\" refs/test2 \"$ref\" &&\n \ttest_must_fail git rev-parse -q --verify refs/test2@{999} >error 2>&1 &&\n \ttest_must_be_empty error\n '\n \n test_expect_success 'succeeds silently with -q and reflogs that do not go far back enough in time' '\n \tref=$(git rev-parse HEAD) &&\n-\t: >.git/logs/refs/test3 &&\n-\tgit update-ref -m \"message for refs/test3\" refs/test3 \"$ref\" &&\n+\tgit update-ref --create-reflog -m \"message for refs/test3\" refs/test3 \"$ref\" &&\n \tgit rev-parse -q --verify refs/test3@{1.year.ago} >actual 2>error &&\n \ttest_must_be_empty error &&\n \techo \"$ref\" >expect &&\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex ddea498..cdaf6f6 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -59,7 +59,7 @@ test_expect_success 'git branch -l d/e/f should create a branch and a log' '\n test_expect_success 'git branch -d d/e/f should delete a branch and a log' '\n \tgit branch -d d/e/f &&\n \ttest_path_is_missing .git/refs/heads/d/e/f &&\n-\ttest_path_is_missing .git/logs/refs/heads/d/e/f\n+\ttest_must_fail git reflog exists refs/heads/d/e/f\n '\n \n test_expect_success 'git branch j/k should work after branch j has been deleted' '\n@@ -82,13 +82,13 @@ test_expect_success 'git branch -m dumps usage' '\n test_expect_success 'git branch -m m m/m should work' '\n \tgit branch -l m &&\n \tgit branch -m m m/m &&\n-\ttest_path_is_file .git/logs/refs/heads/m/m\n+\tgit reflog exists refs/heads/m/m\n '\n \n test_expect_success 'git branch -m n/n n should work' '\n \tgit branch -l n/n &&\n \tgit branch -m n/n n &&\n-\ttest_path_is_file .git/logs/refs/heads/n\n+\tgit reflog exists refs/heads/n\n '\n \n test_expect_success 'git branch -m o/o o should fail when o/p exists' '\n@@ -267,12 +267,12 @@ git config branch.s/s.dummy Hello\n \n test_expect_success 'git branch -m s/s s should work when s/t is deleted' '\n \tgit branch -l s/s &&\n-\ttest_path_is_file .git/logs/refs/heads/s/s &&\n+\tgit reflog exists refs/heads/s/s &&\n \tgit branch -l s/t &&\n-\ttest_path_is_file .git/logs/refs/heads/s/t &&\n+\tgit reflog exists refs/heads/s/t &&\n \tgit branch -d s/t &&\n \tgit branch -m s/s s &&\n-\ttest_path_is_file .git/logs/refs/heads/s\n+\tgit reflog exists refs/heads/s\n '\n \n test_expect_success 'config information was renamed, too' '\ndiff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh\nindex 8aae98d..7b5b6d4 100755\n--- a/t/t3210-pack-refs.sh\n+++ b/t/t3210-pack-refs.sh\n@@ -169,7 +169,7 @@ test_expect_success 'create packed foo/bar/baz branch' '\n \tgit branch foo/bar/baz &&\n \tgit pack-refs --all --prune &&\n \ttest_path_is_missing .git/refs/heads/foo/bar/baz &&\n-\ttest_path_is_missing .git/logs/refs/heads/foo/bar/baz\n+\ttest_must_fail git reflog exists refs/heads/foo/bar/baz\n '\n \n test_expect_success 'notice d/f conflict with existing directory' '\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 467e6c1..dc76754 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -961,13 +961,13 @@ test_expect_success 'rebase -i produces readable reflog' '\n \tset_fake_editor &&\n \tgit rebase -i --onto I F branch-reflog-test &&\n \tcat >expect <<-\\EOF &&\n-\trebase -i (start): checkout I\n-\trebase -i (pick): G\n-\trebase -i (pick): H\n \trebase -i (finish): returning to refs/heads/branch-reflog-test\n+\trebase -i (pick): H\n+\trebase -i (pick): G\n+\trebase -i (start): checkout I\n \tEOF\n-\ttail -n 4 .git/logs/HEAD |\n-\tsed -e \"s/.*\t//\" >actual &&\n+\tgit reflog HEAD -n4 |\n+\tsed \"s/[^:]*: //\" >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex f5f18b7..2142c1f 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -672,7 +672,7 @@ test_expect_success 'store updates stash ref and reflog' '\n \t! grep quux bazzy &&\n \tgit stash store -m quuxery $STASH_ID &&\n \ttest $(cat .git/refs/stash) = $STASH_ID &&\n-\tgrep $STASH_ID .git/logs/refs/stash &&\n+\tgit reflog --format=%H stash| grep $STASH_ID &&\n \tgit stash pop &&\n \tgrep quux bazzy\n '\ndiff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh\nindex 8e98b44..da9d599 100755\n--- a/t/t5312-prune-corruption.sh\n+++ b/t/t5312-prune-corruption.sh\n@@ -12,7 +12,7 @@ delete objects that cannot be recovered.\n \n test_expect_success 'disable reflogs' '\n \tgit config core.logallrefupdates false &&\n-\trm -rf .git/logs\n+\tgit reflog expire --expire=all --all\n '\n \n test_expect_success 'create history reachable only from a bogus-named ref' '\ndiff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh\nindex 2adf825..cf076dc 100755\n--- a/t/t6501-freshen-objects.sh\n+++ b/t/t6501-freshen-objects.sh\n@@ -56,7 +56,7 @@ for repack in '' true; do\n \n \ttest_expect_success \"disable reflogs ($title)\" '\n \t\tgit config core.logallrefupdates false &&\n-\t\trm -rf .git/logs\n+\t\tgit reflog expire --expire=all --all\n \t'\n \n \ttest_expect_success \"setup basic history ($title)\" '\ndiff --git a/t/t7509-commit.sh b/t/t7509-commit.sh\nindex 9ac7940..db9774e 100755\n--- a/t/t7509-commit.sh\n+++ b/t/t7509-commit.sh\n@@ -90,22 +90,10 @@ sha1_file() {\n remove_object() {\n \trm -f $(sha1_file \"$*\")\n }\n-no_reflog() {\n-\tcp .git/config .git/config.saved &&\n-\techo \"[core] logallrefupdates = false\" >>.git/config &&\n-\ttest_when_finished \"mv -f .git/config.saved .git/config\" &&\n-\n-\tif test -e .git/logs\n-\tthen\n-\t\tmv .git/logs . &&\n-\t\ttest_when_finished \"mv logs .git/\"\n-\tfi\n-}\n \n test_expect_success '--amend option with empty author' '\n \tgit cat-file commit Initial >tmp &&\n \tsed \"s/author [^<]* </author  </\" tmp >empty-author &&\n-\tno_reflog &&\n \tsha=$(git hash-object -t commit -w empty-author) &&\n \ttest_when_finished \"remove_object $sha\" &&\n \tgit checkout $sha &&\n@@ -119,7 +107,6 @@ test_expect_success '--amend option with empty author' '\n test_expect_success '--amend option with missing author' '\n \tgit cat-file commit Initial >tmp &&\n \tsed \"s/author [^<]* </author </\" tmp >malformed &&\n-\tno_reflog &&\n \tsha=$(git hash-object -t commit -w malformed) &&\n \ttest_when_finished \"remove_object $sha\" &&\n \tgit checkout $sha &&\n-- \n2.0.4.315.gad8727a-twtrsrc\n"},{"id":"266867","messageId":"xmqqlhe1gtnb.fsf@gitster.dls.corp.google.com","threadId":"39945","inReplyTo":"1438028034-23609-1-git-send-email-dturner@twopensource.com","subject":"Re: [PATCH] tests: Remove some direct access to .git/logs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-27T21:47:20Z","receivedAt":"2015-07-27T21:47:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Turner <dturner@twopensource.com> writes:\n\n> -: a repository with working tree always has reflog these days...\n> -: >.git/logs/refs/heads/master\n> +rm -f .git/logs/refs/heads/master\n\nThis looks quite different from how other tests are updated (which\nlooked a lot more sensible).  The original has the effect of (1)\nensuring that the log exists/is enabled for 'master' branch and (2)\nthat log is emptied.  The updated has a quite different effect,\nbut only when you are using filesystem based backend.\n\n>  test_expect_success \\\n>  \t\"create $m (logged by touch)\" \\\n>  \t'GIT_COMMITTER_DATE=\"2005-05-26 23:30\" \\\n> -\t git update-ref HEAD '\"$A\"' -m \"Initial Creation\" &&\n> +\t git update-ref --create-reflog HEAD '\"$A\"' -m \"Initial Creation\" &&\n>  \t test '\"$A\"' = $(cat .git/'\"$m\"')'\n\nAnd this update compensates for the earlier \"remove 'master' reflog\"\n(where it should have been \"ensure creation and empty it\") by\ncreating, but it is unclear what would happen when we start using\ndifferent ref backends.  Earlier we did not remove reflog from the\nbackend, and we say \"create\" here---it would hopefully not error\nout, but it does not quite feel right.  Perhaps create and\nimmediately prune all instead?  That feels like more in line with\nthe way the other change in this patch do things.\n\n> -\ttest_line_count = 4 .git/logs/refs/heads/master\n> +\tgit reflog refs/heads/master >output &&\n> +\ttest_line_count = 4 output\n>  '\n\nThese all look sensible.\n\n> diff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh\n> index 6f47c0d..d568b35 100755\n> --- a/t/t1411-reflog-show.sh\n> +++ b/t/t1411-reflog-show.sh\n> @@ -138,7 +138,7 @@ test_expect_success '--date magic does not override explicit @{0} syntax' '\n>  : >expect\n>  test_expect_success 'empty reflog file' '\n>  \tgit branch empty &&\n> -\t: >.git/logs/refs/heads/empty &&\n> +\tgit reflog expire --expire=all refs/heads/empty &&\n\nThis one is what I was talking about in the earlier part of this\nmessage.  This looks very sensible.\n\n>  test_expect_success 'fails silently when using -q with deleted reflogs' '\n>  \tref=$(git rev-parse HEAD) &&\n> -\t: >.git/logs/refs/test &&\n> -\tgit update-ref -m \"message for refs/test\" refs/test \"$ref\" &&\n> +\tgit update-ref --create-reflog -m \"message for refs/test\" refs/test \"$ref\" &&\n\nI cannot tell without enough pre-context, but I assume that we know\nthere is no reflog for refs/test when this test piece starts---in\nwhich case this change looks sensible.\n\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 467e6c1..dc76754 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -961,13 +961,13 @@ test_expect_success 'rebase -i produces readable reflog' '\n>  \tset_fake_editor &&\n>  \tgit rebase -i --onto I F branch-reflog-test &&\n>  \tcat >expect <<-\\EOF &&\n> -\trebase -i (start): checkout I\n> -\trebase -i (pick): G\n> -\trebase -i (pick): H\n>  \trebase -i (finish): returning to refs/heads/branch-reflog-test\n> +\trebase -i (pick): H\n> +\trebase -i (pick): G\n> +\trebase -i (start): checkout I\n>  \tEOF\n\n;-)\n\n> -\ttail -n 4 .git/logs/HEAD |\n> -\tsed -e \"s/.*\t//\" >actual &&\n> +\tgit reflog HEAD -n4 |\n\nThis may happen to work but teaches a bad habit to readers.  Always\norder your command line by starting with dashed-options, then refs\nand then pathspecs.\n\n> diff --git a/t/t7509-commit.sh b/t/t7509-commit.sh\n> index 9ac7940..db9774e 100755\n> --- a/t/t7509-commit.sh\n> +++ b/t/t7509-commit.sh\n> @@ -90,22 +90,10 @@ sha1_file() {\n>  remove_object() {\n>  \trm -f $(sha1_file \"$*\")\n>  }\n> -no_reflog() {\n> -\tcp .git/config .git/config.saved &&\n> -\techo \"[core] logallrefupdates = false\" >>.git/config &&\n> -\ttest_when_finished \"mv -f .git/config.saved .git/config\" &&\n> -\n> -\tif test -e .git/logs\n> -\tthen\n> -\t\tmv .git/logs . &&\n> -\t\ttest_when_finished \"mv logs .git/\"\n> -\tfi\n> -}\n>  \n>  test_expect_success '--amend option with empty author' '\n>  \tgit cat-file commit Initial >tmp &&\n>  \tsed \"s/author [^<]* </author  </\" tmp >empty-author &&\n> -\tno_reflog &&\n>  \tsha=$(git hash-object -t commit -w empty-author) &&\n>  \ttest_when_finished \"remove_object $sha\" &&\n>  \tgit checkout $sha &&\n> @@ -119,7 +107,6 @@ test_expect_success '--amend option with empty author' '\n>  test_expect_success '--amend option with missing author' '\n>  \tgit cat-file commit Initial >tmp &&\n>  \tsed \"s/author [^<]* </author </\" tmp >malformed &&\n> -\tno_reflog &&\n>  \tsha=$(git hash-object -t commit -w malformed) &&\n>  \ttest_when_finished \"remove_object $sha\" &&\n>  \tgit checkout $sha &&\n\nI can understand that .git/logs/ cannot be relied upon when you move\nyour ref backend out of filesystem, but that does not quite explain\nwhy this change makes sense.  Puzzled...\n"},{"id":"266871","messageId":"1438037765.18134.8.camel@twopensource.com","threadId":"39945","inReplyTo":"xmqqlhe1gtnb.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] tests: Remove some direct access to .git/logs","fromName":"David Turner","fromEmail":"dturner@twopensource.com","sentAt":"2015-07-27T22:56:05Z","receivedAt":"2015-07-27T22:56:05Z","isPatch":true,"sender":{"key":"novalis@novalis.org","avatar":"https://avatars.githubusercontent.com/u/77003?v=4"},"body":"On Mon, 2015-07-27 at 14:47 -0700, Junio C Hamano wrote:\n> David Turner <dturner@twopensource.com> writes:\n> \n> > -: a repository with working tree always has reflog these days...\n> > -: >.git/logs/refs/heads/master\n> > +rm -f .git/logs/refs/heads/master\n> \n> This looks quite different from how other tests are updated (which\n> looked a lot more sensible).  The original has the effect of (1)\n> ensuring that the log exists/is enabled for 'master' branch and (2)\n> that log is emptied.  The updated has a quite different effect,\n> but only when you are using filesystem based backend.\n\nYes, this is one of the areas where we need to do more work for\nalternate backends -- for instance, we could provide a \"git reflog\nremove\" command to replace that rm.  As the commit message notes, this\npatch is a subset of what's necessary for multiple backends.\n\nThere are a number of other tests that e.g. rm -r .git/logs, which we\nwould also need to change for alternate backends.  \n\n> >  test_expect_success \\\n> >  \t\"create $m (logged by touch)\" \\\n> >  \t'GIT_COMMITTER_DATE=\"2005-05-26 23:30\" \\\n> > -\t git update-ref HEAD '\"$A\"' -m \"Initial Creation\" &&\n> > +\t git update-ref --create-reflog HEAD '\"$A\"' -m \"Initial Creation\" &&\n> >  \t test '\"$A\"' = $(cat .git/'\"$m\"')'\n> \n> And this update compensates for the earlier \"remove 'master' reflog\"\n> (where it should have been \"ensure creation and empty it\") by\n> creating, but it is unclear what would happen when we start using\n> different ref backends.  Earlier we did not remove reflog from the\n> backend, and we say \"create\" here---it would hopefully not error\n> out, but it does not quite feel right.  Perhaps create and\n> immediately prune all instead?  That feels like more in line with\n> the way the other change in this patch do things.\n\nIf we create and immediately prune all, we'll lose the initial creation\nentry, which we presumably want to test.\n\n> >  test_expect_success 'fails silently when using -q with deleted reflogs' '\n> >  \tref=$(git rev-parse HEAD) &&\n> > -\t: >.git/logs/refs/test &&\n> > -\tgit update-ref -m \"message for refs/test\" refs/test \"$ref\" &&\n> > +\tgit update-ref --create-reflog -m \"message for refs/test\" refs/test \"$ref\" &&\n> \n> I cannot tell without enough pre-context, but I assume that we know\n> there is no reflog for refs/test when this test piece starts---in\n> which case this change looks sensible.\n\nYes, that is correct.\n\n> > -\ttail -n 4 .git/logs/HEAD |\n> > -\tsed -e \"s/.*\t//\" >actual &&\n> > +\tgit reflog HEAD -n4 |\n> \n> This may happen to work but teaches a bad habit to readers.  Always\n> order your command line by starting with dashed-options, then refs\n> and then pathspecs.\n\nWill fix on reroll.\n\n> > diff --git a/t/t7509-commit.sh b/t/t7509-commit.sh\n> > index 9ac7940..db9774e 100755\n> > --- a/t/t7509-commit.sh\n> > +++ b/t/t7509-commit.sh\n> > @@ -90,22 +90,10 @@ sha1_file() {\n> >  remove_object() {\n> >  \trm -f $(sha1_file \"$*\")\n> >  }\n> > -no_reflog() {\n> > -\tcp .git/config .git/config.saved &&\n> > -\techo \"[core] logallrefupdates = false\" >>.git/config &&\n> > -\ttest_when_finished \"mv -f .git/config.saved .git/config\" &&\n> > -\n> > -\tif test -e .git/logs\n> > -\tthen\n> > -\t\tmv .git/logs . &&\n> > -\t\ttest_when_finished \"mv logs .git/\"\n> > -\tfi\n> > -}\n> >  \n> >  test_expect_success '--amend option with empty author' '\n> >  \tgit cat-file commit Initial >tmp &&\n> >  \tsed \"s/author [^<]* </author  </\" tmp >empty-author &&\n> > -\tno_reflog &&\n> >  \tsha=$(git hash-object -t commit -w empty-author) &&\n> >  \ttest_when_finished \"remove_object $sha\" &&\n> >  \tgit checkout $sha &&\n> > @@ -119,7 +107,6 @@ test_expect_success '--amend option with empty author' '\n> >  test_expect_success '--amend option with missing author' '\n> >  \tgit cat-file commit Initial >tmp &&\n> >  \tsed \"s/author [^<]* </author </\" tmp >malformed &&\n> > -\tno_reflog &&\n> >  \tsha=$(git hash-object -t commit -w malformed) &&\n> >  \ttest_when_finished \"remove_object $sha\" &&\n> >  \tgit checkout $sha &&\n> \n> I can understand that .git/logs/ cannot be relied upon when you move\n> your ref backend out of filesystem, but that does not quite explain\n> why this change makes sense.  Puzzled...\n\nIt turns out that the removed portion of the test is totally\nunnecessary; the tests are completely unrelated to reflogs.\n\nOn the reroll, I'll split this into a separate patch with its own\nexplanation.\n"}]}