git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: Han-Wen Nienhuys <hanwen@google.com>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Taylor Blau <me@ttaylorr.com>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v3 0/9] t: reduce direct disk access to data structures
Date: Thu, 2 Nov 2023 09:46:36 +0100	[thread overview]
Message-ID: <cover.1698914571.git.ps@pks.im> (raw)
In-Reply-To: <cover.1697607222.git.ps@pks.im>

[-- Attachment #1: Type: text/plain, Size: 8559 bytes --]

Hi,

this is the third version of my patch series that aims to reduce access
to on-disk data structures in favor of using plumbing tools where
possible.

There are no changes compared to v2 except for a rebase on top of
0497e6c611 (t: use git-show-ref(1) to check for ref existence,
2023-10-31), which has been merged to "next" now and conflicts with this
patch series.

Patrick

Patrick Steinhardt (9):
  t: allow skipping expected object ID in `ref-store update-ref`
  t: convert tests to not write references via the filesystem
  t: convert tests to not access symrefs via the filesystem
  t: convert tests to not access reflog via the filesystem
  t1450: convert tests to remove worktrees via git-worktree(1)
  t4207: delete replace references via git-update-ref(1)
  t7300: assert exact states of repo
  t7900: assert the absence of refs via git-for-each-ref(1)
  t: mark several tests that assume the files backend with REFFILES

 t/helper/test-ref-store.c          | 11 ++++---
 t/t1400-update-ref.sh              | 50 ++++++++++++++++--------------
 t/t1430-bad-ref-name.sh            | 12 +++----
 t/t1450-fsck.sh                    | 44 +++++++++++++-------------
 t/t2011-checkout-invalid-head.sh   | 16 +++++-----
 t/t3200-branch.sh                  | 41 ++++++++++++------------
 t/t3400-rebase.sh                  |  2 +-
 t/t3404-rebase-interactive.sh      |  2 +-
 t/t4013-diff-various.sh            |  2 +-
 t/t4202-log.sh                     |  2 +-
 t/t4207-log-decoration-colors.sh   | 10 ++++--
 t/t5526-fetch-submodules.sh        |  2 +-
 t/t5605-clone-local.sh             |  4 +--
 t/t5702-protocol-v2.sh             | 24 ++++++++++----
 t/t7300-clean.sh                   | 23 ++++++++------
 t/t7900-maintenance.sh             |  3 +-
 t/t9133-git-svn-nested-git-repo.sh |  2 +-
 17 files changed, 142 insertions(+), 108 deletions(-)

Range-diff against v2:
 1:  c868198f8c1 =  1:  3caf9e3f28f t: allow skipping expected object ID in `ref-store update-ref`
 2:  4c0939d868e =  2:  1884b7006cf t: convert tests to not write references via the filesystem
 3:  048583ed2c3 !  3:  d6307177132 t: convert tests to not access symrefs via the filesystem
    @@ t/t1430-bad-ref-name.sh: test_expect_success 'update-ref -d can delete broken na
     -	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
     +	test-tool ref-store main create-symref refs/heads/broken...symref refs/heads/main &&
      	test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" &&
    + 	test_ref_exists refs/heads/broken...symref &&
      	git update-ref --no-deref -d refs/heads/broken...symref >output 2>error &&
    - 	test_path_is_missing .git/refs/heads/broken...symref &&
     @@ t/t1430-bad-ref-name.sh: test_expect_success 'update-ref --no-deref -d can delete symref with broken name
      '
      
    @@ t/t1430-bad-ref-name.sh: test_expect_success 'update-ref --no-deref -d can delet
     -	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
     +	test-tool ref-store main create-symref refs/heads/broken...symref refs/heads/main &&
      	test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" &&
    + 	test_ref_exists refs/heads/broken...symref &&
      	git branch -d broken...symref >output 2>error &&
    - 	test_path_is_missing .git/refs/heads/broken...symref &&
     @@ t/t1430-bad-ref-name.sh: test_expect_success 'branch -d can delete symref with broken name' '
      '
      
    @@ t/t1430-bad-ref-name.sh: test_expect_success 'branch -d can delete symref with b
     -	printf "ref: refs/heads/idonotexist\n" >.git/refs/heads/broken...symref &&
     +	test-tool ref-store main create-symref refs/heads/broken...symref refs/heads/idonotexist &&
      	test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" &&
    + 	test_ref_exists refs/heads/broken...symref &&
      	git update-ref --no-deref -d refs/heads/broken...symref >output 2>error &&
    - 	test_path_is_missing .git/refs/heads/broken...symref &&
     @@ t/t1430-bad-ref-name.sh: test_expect_success 'update-ref --no-deref -d can delete dangling symref with br
      '
      
    @@ t/t1430-bad-ref-name.sh: test_expect_success 'update-ref --no-deref -d can delet
     -	printf "ref: refs/heads/idonotexist\n" >.git/refs/heads/broken...symref &&
     +	test-tool ref-store main create-symref refs/heads/broken...symref refs/heads/idonotexist &&
      	test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" &&
    + 	test_ref_exists refs/heads/broken...symref &&
      	git branch -d broken...symref >output 2>error &&
    - 	test_path_is_missing .git/refs/heads/broken...symref &&
     
      ## t/t1450-fsck.sh ##
     @@ t/t1450-fsck.sh: test_expect_success 'HEAD link pointing at a funny object' '
    @@ t/t3200-branch.sh: test_expect_success 'git branch -M should leave orphaned HEAD
     +		git symbolic-ref HEAD >expect &&
     +		echo refs/heads/lonely >actual &&
     +		test_cmp expect actual &&
    - 		test_path_is_missing .git/refs/head/lonely &&
    + 		test_ref_missing refs/head/lonely &&
      		git branch -M main mistress &&
     -		grep lonely .git/HEAD
     +		git symbolic-ref HEAD >expect &&
    @@ t/t3200-branch.sh: test_expect_success 'deleting a symref' '
     +	git symbolic-ref --no-recurse refs/heads/dangling-symref &&
      	echo "Deleted branch dangling-symref (was nowhere)." >expect &&
      	git branch -d dangling-symref >actual &&
    - 	test_path_is_missing .git/refs/heads/dangling-symref &&
    + 	test_ref_missing refs/heads/dangling-symref &&
     
      ## t/t4013-diff-various.sh ##
     @@ t/t4013-diff-various.sh: test_expect_success 'log -S requires an argument' '
 4:  5e7937e7904 !  4:  fdf67689227 t: convert tests to not access reflog via the filesystem
    @@ t/t3200-branch.sh: test_expect_success 'git branch HEAD should fail' '
      test_expect_success 'git branch --create-reflog d/e/f should create a branch and a log' '
      	GIT_COMMITTER_DATE="2005-05-26 23:30" \
      	git -c core.logallrefupdates=false branch --create-reflog d/e/f &&
    - 	test_path_is_file .git/refs/heads/d/e/f &&
    + 	test_ref_exists refs/heads/d/e/f &&
     -	test_path_is_file .git/logs/refs/heads/d/e/f &&
     -	test_cmp expect .git/logs/refs/heads/d/e/f
     +	git reflog show --no-abbrev-commit refs/heads/d/e/f >actual &&
    @@ t/t3200-branch.sh: test_expect_success '--set-upstream-to notices an error to se
      test_expect_success 'git checkout -b g/h/i -l should create a branch and a log' '
      	GIT_COMMITTER_DATE="2005-05-26 23:30" \
      	git checkout -b g/h/i -l main &&
    - 	test_path_is_file .git/refs/heads/g/h/i &&
    + 	test_ref_exists refs/heads/g/h/i &&
     -	test_path_is_file .git/logs/refs/heads/g/h/i &&
     -	test_cmp expect .git/logs/refs/heads/g/h/i
     +	git reflog show --no-abbrev-commit refs/heads/g/h/i >actual &&
 5:  089565a358e =  5:  a5d55b68828 t1450: convert tests to remove worktrees via git-worktree(1)
 6:  cb738888ed7 =  6:  3213d45b537 t4207: delete replace references via git-update-ref(1)
 7:  e730e011de4 =  7:  36e79f266c2 t7300: assert exact states of repo
 8:  a1bdea52397 =  8:  4af0dc00165 t7900: assert the absence of refs via git-for-each-ref(1)
 9:  497e43ae5c3 !  9:  9fc039a1764 t: mark several tests that assume the files backend with REFFILES
    @@ t/t2011-checkout-invalid-head.sh: test_expect_success 'create ref directory/file
     
      ## t/t3200-branch.sh ##
     @@ t/t3200-branch.sh: test_expect_success 'git branch --help should not have created a bogus branch' '
    - 	test_path_is_missing .git/refs/heads/--help
    + 	test_ref_missing refs/heads/--help
      '
      
     -test_expect_success 'branch -h in broken repository' '
    @@ t/t3200-branch.sh: test_expect_success 'git branch -M baz bam should succeed whe
      	git worktree add -f bazdir2 baz &&
      	touch .git/worktrees/bazdir1/HEAD.lock &&
     @@ t/t3200-branch.sh: test_expect_success 'renaming a symref is not allowed' '
    - 	test_path_is_missing .git/refs/heads/new-topic
    + 	test_ref_missing refs/heads/new-topic
      '
      
     -test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '

base-commit: 0497e6c61172faabf412e013f2fc30a05054a46d
-- 
2.42.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2023-11-02  8:47 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18  5:35 [PATCH 00/11] t: reduce direct disk access to data structures Patrick Steinhardt
2023-10-18  5:35 ` [PATCH 01/11] t: add helpers to test for reference existence Patrick Steinhardt
2023-10-18 16:06   ` Junio C Hamano
2023-10-23 13:58     ` Patrick Steinhardt
2023-10-18 17:08   ` Eric Sunshine
2023-10-23 13:58     ` Patrick Steinhardt
2023-10-18  5:35 ` [PATCH 02/11] t: allow skipping expected object ID in `ref-store update-ref` Patrick Steinhardt
2023-10-18 16:08   ` Junio C Hamano
2023-10-23 13:58     ` Patrick Steinhardt
2023-10-23 19:06       ` Junio C Hamano
2023-10-18  5:35 ` [PATCH 03/11] t: convert tests to use helpers for reference existence Patrick Steinhardt
2023-10-18 16:28   ` Junio C Hamano
2023-10-18  5:35 ` [PATCH 04/11] t: convert tests to not write references via the filesystem Patrick Steinhardt
2023-10-18 18:34   ` Junio C Hamano
2023-10-23 13:58     ` Patrick Steinhardt
2023-10-23 19:10       ` Junio C Hamano
2023-10-18 21:18   ` Junio C Hamano
2023-10-23 13:58     ` Patrick Steinhardt
2023-10-18  5:35 ` [PATCH 05/11] t: convert tests to not access symrefs " Patrick Steinhardt
2023-10-20 19:52   ` Junio C Hamano
2023-10-18  5:35 ` [PATCH 06/11] t: convert tests to not access reflog " Patrick Steinhardt
2023-10-21 23:13   ` Junio C Hamano
2023-10-18  5:35 ` [PATCH 07/11] t1450: convert tests to remove worktrees via git-worktree(1) Patrick Steinhardt
2023-10-18  5:35 ` [PATCH 08/11] t4207: delete replace references via git-update-ref(1) Patrick Steinhardt
2023-10-18 13:27   ` Han-Wen Nienhuys
2023-10-23 13:58     ` Patrick Steinhardt
2023-10-23 16:42   ` Taylor Blau
2023-10-24  6:42     ` Patrick Steinhardt
2023-10-18  5:35 ` [PATCH 09/11] t7300: assert exact states of repo Patrick Steinhardt
2023-10-18  5:35 ` [PATCH 10/11] t7900: assert the absence of refs via git-for-each-ref(1) Patrick Steinhardt
2023-10-18  5:35 ` [PATCH 11/11] t: mark several tests that assume the files backend with REFFILES Patrick Steinhardt
2023-10-18  5:39 ` [PATCH 00/11] t: reduce direct disk access to data structures Patrick Steinhardt
2023-10-18 23:40   ` Junio C Hamano
2023-10-23 11:57     ` Patrick Steinhardt
2023-10-18 15:32 ` Junio C Hamano
2023-10-19 10:13   ` Han-Wen Nienhuys
2023-10-19 17:55     ` Junio C Hamano
2023-10-23 13:58     ` Patrick Steinhardt
2023-10-24 14:04 ` [PATCH v2 0/9] " Patrick Steinhardt
2023-10-24 14:04   ` [PATCH v2 1/9] t: allow skipping expected object ID in `ref-store update-ref` Patrick Steinhardt
2023-10-24 14:04   ` [PATCH v2 2/9] t: convert tests to not write references via the filesystem Patrick Steinhardt
2023-10-24 14:05   ` [PATCH v2 3/9] t: convert tests to not access symrefs " Patrick Steinhardt
2023-10-24 14:05   ` [PATCH v2 4/9] t: convert tests to not access reflog " Patrick Steinhardt
2023-10-24 14:05   ` [PATCH v2 5/9] t1450: convert tests to remove worktrees via git-worktree(1) Patrick Steinhardt
2023-10-27  2:42     ` Eric Sunshine
2023-10-24 14:05   ` [PATCH v2 6/9] t4207: delete replace references via git-update-ref(1) Patrick Steinhardt
2023-10-24 14:05   ` [PATCH v2 7/9] t7300: assert exact states of repo Patrick Steinhardt
2023-10-24 14:05   ` [PATCH v2 8/9] t7900: assert the absence of refs via git-for-each-ref(1) Patrick Steinhardt
2023-10-24 14:05   ` [PATCH v2 9/9] t: mark several tests that assume the files backend with REFFILES Patrick Steinhardt
2023-11-02  8:46 ` Patrick Steinhardt [this message]
2023-11-02  8:46   ` [PATCH v3 1/9] t: allow skipping expected object ID in `ref-store update-ref` Patrick Steinhardt
2023-11-02  8:46   ` [PATCH v3 2/9] t: convert tests to not write references via the filesystem Patrick Steinhardt
2023-11-02  8:46   ` [PATCH v3 3/9] t: convert tests to not access symrefs " Patrick Steinhardt
2023-11-02  8:46   ` [PATCH v3 4/9] t: convert tests to not access reflog " Patrick Steinhardt
2023-11-02  8:46   ` [PATCH v3 5/9] t1450: convert tests to remove worktrees via git-worktree(1) Patrick Steinhardt
2023-11-02  8:47   ` [PATCH v3 6/9] t4207: delete replace references via git-update-ref(1) Patrick Steinhardt
2023-11-02  8:47   ` [PATCH v3 7/9] t7300: assert exact states of repo Patrick Steinhardt
2023-11-02  8:47   ` [PATCH v3 8/9] t7900: assert the absence of refs via git-for-each-ref(1) Patrick Steinhardt
2023-11-02  8:47   ` [PATCH v3 9/9] t: mark several tests that assume the files backend with REFFILES Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1698914571.git.ps@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hanwen@google.com \
    --cc=me@ttaylorr.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).