Subject: Re: [PATCH 4/4] t7004: use "test-tool ref-store" for reflog inspection

From: Junio C Hamano <[email-masked]>
Date: Wed, 22 Dec 2021 12:17:06 -0800

"Han-Wen Nienhuys via GitGitGadget" <[email-masked]> writes:

> From: Han-Wen Nienhuys <[email-masked]>
>
> This makes the test work with reftable.
>
> Signed-off-by: Han-Wen Nienhuys <[email-masked]>
> ...
> -	sed -e "s/^.*	//" .git/logs/refs/tags/tag_with_reflog2 >actual &&
> +	test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog2 | sed -e "s/^.*	//" >actual &&
>  	test_cmp expected actual
>  '

Yup, this makes perfect sense.  Purists may be bothered by having
anything _we_ write, like "test-tool" on the upstream of a pipe to
hide its exit code, though.

After applying these four patches on top of 'master', I still see
some mention of logs/refs in the t/ directory.  Some of them may
be a low-hanging fruit other people can take a look at and convert
to the test-helper calls to help us move the reftable topic forward
without stepping on your toes, hopefully?

Thanks.

t/t0060-path-utils.sh:test_git_path GIT_COMMON_DIR=bar logs/refs/bisect/foo     .git/logs/refs/bisect/foo
t/t0060-path-utils.sh:test_git_path GIT_COMMON_DIR=bar logs/refs                bar/logs/refs
t/t0060-path-utils.sh:test_git_path GIT_COMMON_DIR=bar logs/refs/               bar/logs/refs/
t/t0060-path-utils.sh:test_git_path GIT_COMMON_DIR=bar logs/refs/bisec/foo      bar/logs/refs/bisec/foo
t/t0060-path-utils.sh:test_git_path GIT_COMMON_DIR=bar logs/refs/bisec          bar/logs/refs/bisec
t/t0060-path-utils.sh:test_git_path GIT_COMMON_DIR=bar logs/refs/bisectfoo      bar/logs/refs/bisectfoo
t/t0060-path-utils.sh:test_git_path GIT_COMMON_DIR=bar logs/refs/heads/main     bar/logs/refs/heads/main
t/t1301-shared-repo.sh:	actual="$(ls -l .git/logs/refs/heads/main)" &&
t/t1301-shared-repo.sh:		echo Ooops, .git/logs/refs/heads/main is not 066x [$actual]
t/t1400-update-ref.sh:rm -f .git/logs/refs/heads/main
t/t1400-update-ref.sh:	test_path_is_file .git/logs/refs/heads/d1/d2/r1 &&
t/t1400-update-ref.sh:	test_must_fail git show-ref --verify -q logs/refs/heads/d1/d2 &&
t/t1400-update-ref.sh:	test_path_is_file .git/logs/refs/heads/d1/r2
t/t1400-update-ref.sh:	test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
t/t1400-update-ref.sh:	test_must_fail git show-ref --verify -q logs/refs/heads/e1/e2 &&
t/t1400-update-ref.sh:	test_path_is_file .git/logs/refs/heads/e1/r2 &&
t/t1407-worktree-ref-store.sh:	mkdir -p     .git/logs/refs/bisect &&
t/t1407-worktree-ref-store.sh:	echo $ZERO_OID > .git/logs/refs/bisect/random &&
t/t1407-worktree-ref-store.sh:	mkdir -p     .git/worktrees/wt/logs/refs/bisect &&
t/t1407-worktree-ref-store.sh:	echo $ZERO_OID > .git/worktrees/wt/logs/refs/bisect/wt-random &&
t/t1410-reflog.sh:	# now logs/refs/heads/one is a stale directory, but
t/t1410-reflog.sh:	done >.git/logs/refs/heads/reflogskip &&
t/t3200-branch.sh:	test_path_is_file .git/logs/refs/heads/d/e/f &&
t/t3200-branch.sh:	test_cmp expect .git/logs/refs/heads/d/e/f
t/t3200-branch.sh:	mv .git/logs/refs/heads/u real-u &&
t/t3200-branch.sh:	ln -s real-u .git/logs/refs/heads/u &&
t/t3200-branch.sh:	test_path_is_file .git/logs/refs/heads/g/h/i &&
t/t3200-branch.sh:	test_cmp expect .git/logs/refs/heads/g/h/i