git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Han-Wen Nienhuys <hanwen@google.com>,
	Han-Wen Nienhuys <hanwenn@gmail.com>,
	Han-Wen Nienhuys <hanwen@google.com>
Subject: [PATCH v2] t1404: mark directory/file conflict tests with REFFILES
Date: Mon, 29 Nov 2021 18:20:22 +0000	[thread overview]
Message-ID: <pull.1148.v2.git.git.1638210022966.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1148.git.git.1637855828856.gitgitgadget@gmail.com>

From: Han-Wen Nienhuys <hanwen@google.com>

The files backend uses file system locking on individual refs, which means a
directory/file conflict can prevent locks being taken. For example, in a repo
with just the ref "foo", an update

    (DELETE "foo") + (ADD "foo/bar")

cannot be executed in the files backend, as one cannot take a lock on foo/bar.

The current reftable proof-of-concept integration supports these tranactions, as
the result is a repo with just "foo/bar", which has no directory/file conflict.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
    t1404: mark directory/file conflict tests with REFFILES
    
    The files backend uses file system locking on individual refs, which
    means a directory/file conflict can prevent locks being taken. For
    example, in a repo with just the ref "foo", an update
    
    (DELETE "foo") + (ADD "foo/bar")
    
    
    cannot be executed in the files backend, as one cannot take a lock on
    foo/bar.
    
    The result is a repo with just "foo/bar", which has no directory/file
    conflict, and this is a valid transaction in reftable.
    
    Signed-off-by: Han-Wen Nienhuys hanwen@google.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1148%2Fhanwen%2Ft1404-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1148/hanwen/t1404-v2
Pull-Request: https://github.com/git/git/pull/1148

Range-diff vs v1:

 1:  55d200a6a83 ! 1:  59e9ea188f5 t1404: mark directory/file conflict tests with REFFILES
     @@ Commit message
      
          cannot be executed in the files backend, as one cannot take a lock on foo/bar.
      
     -    The result is a repo with just "foo/bar", which has no directory/file conflict,
     -    and this is a valid transaction in reftable.
     +    The current reftable proof-of-concept integration supports these tranactions, as
     +    the result is a repo with just "foo/bar", which has no directory/file conflict.
      
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
     @@ t/t1404-update-ref-errors.sh: test_expect_success REFFILES 'empty directory shou
       '
       
      -test_expect_success 'D/F conflict prevents add long + delete short' '
     -+test_expect_success REFFILES  'D/F conflict prevents add long + delete short' '
     ++test_expect_success REFFILES 'D/F conflict prevents add long + delete short' '
       	df_test refs/df-al-ds --add-del foo/bar foo
       '
       
     @@ t/t1404-update-ref-errors.sh: test_expect_success REFFILES 'empty directory shou
       '
       
      -test_expect_success 'D/F conflict prevents delete long + add short' '
     -+test_expect_success REFFILES  'D/F conflict prevents delete long + add short' '
     ++test_expect_success REFFILES 'D/F conflict prevents delete long + add short' '
       	df_test refs/df-dl-as --del-add foo/bar foo
       '
       
     @@ t/t1404-update-ref-errors.sh: test_expect_success REFFILES 'empty directory shou
       '
       
      -test_expect_success 'D/F conflict prevents indirect add long + indirect delete short' '
     -+test_expect_success REFFILES 'D/F conflict prevents indirect add long + delete short' '
     -+	df_test refs/df-ial-ds --sym-add --add-del foo/bar foo
     -+'
     -+
     -+test_expect_success REFFILES 'D/F conflict prevents indirect add long + delete short' '
     -+	df_test refs/df-ial-ds --sym-add --add-del foo/bar foo
     -+'
     -+
      +test_expect_success REFFILES 'D/F conflict prevents indirect add long + indirect delete short' '
       	df_test refs/df-ial-ids --sym-add --sym-del --add-del foo/bar foo
       '


 t/t1404-update-ref-errors.sh | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh
index b729c1f4803..13c2b43bbae 100755
--- a/t/t1404-update-ref-errors.sh
+++ b/t/t1404-update-ref-errors.sh
@@ -261,69 +261,69 @@ test_expect_success REFFILES 'empty directory should not fool 1-arg delete' '
 	git update-ref --stdin
 '
 
-test_expect_success 'D/F conflict prevents add long + delete short' '
+test_expect_success REFFILES 'D/F conflict prevents add long + delete short' '
 	df_test refs/df-al-ds --add-del foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents add short + delete long' '
+test_expect_success REFFILES 'D/F conflict prevents add short + delete long' '
 	df_test refs/df-as-dl --add-del foo foo/bar
 '
 
-test_expect_success 'D/F conflict prevents delete long + add short' '
+test_expect_success REFFILES 'D/F conflict prevents delete long + add short' '
 	df_test refs/df-dl-as --del-add foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents delete short + add long' '
+test_expect_success REFFILES 'D/F conflict prevents delete short + add long' '
 	df_test refs/df-ds-al --del-add foo foo/bar
 '
 
-test_expect_success 'D/F conflict prevents add long + delete short packed' '
+test_expect_success REFFILES 'D/F conflict prevents add long + delete short packed' '
 	df_test refs/df-al-dsp --pack --add-del foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents add short + delete long packed' '
+test_expect_success REFFILES 'D/F conflict prevents add short + delete long packed' '
 	df_test refs/df-as-dlp --pack --add-del foo foo/bar
 '
 
-test_expect_success 'D/F conflict prevents delete long packed + add short' '
+test_expect_success REFFILES 'D/F conflict prevents delete long packed + add short' '
 	df_test refs/df-dlp-as --pack --del-add foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents delete short packed + add long' '
+test_expect_success REFFILES 'D/F conflict prevents delete short packed + add long' '
 	df_test refs/df-dsp-al --pack --del-add foo foo/bar
 '
 
 # Try some combinations involving symbolic refs...
 
-test_expect_success 'D/F conflict prevents indirect add long + delete short' '
+test_expect_success REFFILES 'D/F conflict prevents indirect add long + delete short' '
 	df_test refs/df-ial-ds --sym-add --add-del foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents indirect add long + indirect delete short' '
+test_expect_success REFFILES 'D/F conflict prevents indirect add long + indirect delete short' '
 	df_test refs/df-ial-ids --sym-add --sym-del --add-del foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents indirect add short + indirect delete long' '
+test_expect_success REFFILES 'D/F conflict prevents indirect add short + indirect delete long' '
 	df_test refs/df-ias-idl --sym-add --sym-del --add-del foo foo/bar
 '
 
-test_expect_success 'D/F conflict prevents indirect delete long + indirect add short' '
+test_expect_success REFFILES 'D/F conflict prevents indirect delete long + indirect add short' '
 	df_test refs/df-idl-ias --sym-add --sym-del --del-add foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents indirect add long + delete short packed' '
+test_expect_success REFFILES 'D/F conflict prevents indirect add long + delete short packed' '
 	df_test refs/df-ial-dsp --sym-add --pack --add-del foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents indirect add long + indirect delete short packed' '
+test_expect_success REFFILES 'D/F conflict prevents indirect add long + indirect delete short packed' '
 	df_test refs/df-ial-idsp --sym-add --sym-del --pack --add-del foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents add long + indirect delete short packed' '
+test_expect_success REFFILES 'D/F conflict prevents add long + indirect delete short packed' '
 	df_test refs/df-al-idsp --sym-del --pack --add-del foo/bar foo
 '
 
-test_expect_success 'D/F conflict prevents indirect delete long packed + indirect add short' '
+test_expect_success REFFILES 'D/F conflict prevents indirect delete long packed + indirect add short' '
 	df_test refs/df-idlp-ias --sym-add --sym-del --pack --del-add foo/bar foo
 '
 

base-commit: 35151cf0720460a897cde9b8039af364743240e7
-- 
gitgitgadget

      parent reply	other threads:[~2021-11-29 22:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 15:57 [PATCH] t1404: mark directory/file conflict tests with REFFILES Han-Wen Nienhuys via GitGitGadget
2021-11-26  7:39 ` Junio C Hamano
2021-11-29 10:57   ` Han-Wen Nienhuys
2021-11-29 17:59     ` Junio C Hamano
2021-11-29 18:20 ` Han-Wen Nienhuys via GitGitGadget [this message]

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=pull.1148.v2.git.git.1638210022966.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hanwen@google.com \
    --cc=hanwenn@gmail.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).