mbox series

[v2,00/11] Fix direct filesystem access in various test files.

Message ID pull.1052.v2.git.git.1626989327.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series Fix direct filesystem access in various test files. | expand

Message

Linus Arver via GitGitGadget July 22, 2021, 9:28 p.m. UTC
This fixes a few test failures in the reftable series.

Han-Wen Nienhuys (11):
  t6050: use git-update-ref rather than filesystem access
  t1503: mark symlink test as REFFILES
  t6120: use git-update-ref rather than filesystem access
  t3320: use git-symbolic-ref rather than filesystem access
  t2402: use ref-store test helper to create broken symlink
  t1405: use 'git reflog exists' to check reflog existence
  t1405: mark test for 'git pack-refs' as REFFILES
  t1410: mark test as REFFILES
  t7064: use update-ref -d to remove upstream branch
  t6500: use "ls -1" to snapshot ref database state
  t6001: avoid direct file system access

 t/t1405-main-ref-store.sh        | 12 ++++++++----
 t/t1410-reflog.sh                |  4 +++-
 t/t1503-rev-parse-verify.sh      |  2 +-
 t/t2402-worktree-list.sh         |  2 +-
 t/t3320-notes-merge-worktrees.sh | 12 +++++++-----
 t/t6001-rev-list-graft.sh        |  3 ++-
 t/t6050-replace.sh               |  2 +-
 t/t6120-describe.sh              |  6 ++++--
 t/t6500-gc.sh                    |  5 +++--
 t/t7064-wtstatus-pv2.sh          |  5 +----
 10 files changed, 31 insertions(+), 22 deletions(-)


base-commit: daab8a564f8bbac55f70f8bf86c070e001a9b006
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1052%2Fhanwen%2Ftest-fixes-v3-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1052/hanwen/test-fixes-v3-v2
Pull-Request: https://github.com/git/git/pull/1052

Range-diff vs v1:

  1:  61a5c3718df =  1:  d7616038d88 t6050: use git-update-ref rather than filesystem access
  2:  49994a0d154 =  2:  cbd2128c331 t1503: mark symlink test as REFFILES
  3:  695921cacb6 =  3:  cbf90c13e5b t6120: use git-update-ref rather than filesystem access
  4:  94d7e144f54 <  -:  ----------- t7509: use git-update-ref rather than filesystem access
  5:  cc400e9131d =  4:  7b98d092811 t3320: use git-symbolic-ref rather than filesystem access
  6:  4d83f70e133 =  5:  0047266de6b t2402: use ref-store test helper to create broken symlink
  -:  ----------- >  6:  eb2c53d19cf t1405: use 'git reflog exists' to check reflog existence
  -:  ----------- >  7:  05dead16f1c t1405: mark test for 'git pack-refs' as REFFILES
  -:  ----------- >  8:  f931a26de58 t1410: mark test as REFFILES
  -:  ----------- >  9:  3685ba90f60 t7064: use update-ref -d to remove upstream branch
  -:  ----------- > 10:  ccdbf3749fe t6500: use "ls -1" to snapshot ref database state
  -:  ----------- > 11:  81e46f95536 t6001: avoid direct file system access

Comments

Junio C Hamano July 23, 2021, 5:44 p.m. UTC | #1
"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:

> This fixes a few test failures in the reftable series.

The early part is already in 'next', and the new ones looked mostly
good.

I didn't quite understand what was going on with "ls -1" though
(what does it even mean to "ls -1" enumerate only the filenames in
.git/reftable directory)?

Thanks.
Han-Wen Nienhuys Aug. 2, 2021, 1:38 p.m. UTC | #2
On Fri, Jul 23, 2021 at 7:44 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > This fixes a few test failures in the reftable series.
>
> The early part is already in 'next', and the new ones looked mostly
> good.
>
> I didn't quite understand what was going on with "ls -1" though
> (what does it even mean to "ls -1" enumerate only the filenames in
> .git/reftable directory)?


By listing the files before and after, we can make sure that the ref
storage wasn't changed.

(perhaps "find -type f" is a better way to do this, though).
Junio C Hamano Aug. 2, 2021, 4:27 p.m. UTC | #3
Han-Wen Nienhuys <hanwen@google.com> writes:

> On Fri, Jul 23, 2021 at 7:44 PM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
>>
>> > This fixes a few test failures in the reftable series.
>>
>> The early part is already in 'next', and the new ones looked mostly
>> good.
>>
>> I didn't quite understand what was going on with "ls -1" though
>> (what does it even mean to "ls -1" enumerate only the filenames in
>> .git/reftable directory)?
>
>
> By listing the files before and after, we can make sure that the ref
> storage wasn't changed.

Meaning that we rely on the fact that we never append to an existing
file?

Thanks.
Junio C Hamano Aug. 2, 2021, 4:28 p.m. UTC | #4
Han-Wen Nienhuys <hanwen@google.com> writes:

> On Fri, Jul 23, 2021 at 7:44 PM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
>>
>> > This fixes a few test failures in the reftable series.
>>
>> The early part is already in 'next', and the new ones looked mostly
>> good.
>>
>> I didn't quite understand what was going on with "ls -1" though
>> (what does it even mean to "ls -1" enumerate only the filenames in
>> .git/reftable directory)?
>
>
> By listing the files before and after, we can make sure that the ref
> storage wasn't changed.

Meaning that we rely on the fact that we never append to an existing
file?  A comment here would have helped.

Thanks.
Han-Wen Nienhuys Aug. 2, 2021, 4:53 p.m. UTC | #5
On Mon, Aug 2, 2021 at 6:28 PM Junio C Hamano <gitster@pobox.com> wrote:
> > By listing the files before and after, we can make sure that the ref
> > storage wasn't changed.
>
> Meaning that we rely on the fact that we never append to an existing
> file?  A comment here would have helped.

Added some more explanation.

I addressed your comments for the other changes (but forgot to update
the cover letter :-/ )