git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t1404: mark directory/file conflict tests with REFFILES
@ 2021-11-25 15:57 Han-Wen Nienhuys via GitGitGadget
  2021-11-26  7:39 ` Junio C Hamano
  2021-11-29 18:20 ` [PATCH v2] " Han-Wen Nienhuys via GitGitGadget
  0 siblings, 2 replies; 5+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-11-25 15:57 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

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 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>
---
    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-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1148/hanwen/t1404-v1
Pull-Request: https://github.com/git/git/pull/1148

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

diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh
index b729c1f4803..fe7b6447cae 100755
--- a/t/t1404-update-ref-errors.sh
+++ b/t/t1404-update-ref-errors.sh
@@ -261,69 +261,77 @@ 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 + 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
 '
 
-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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] t1404: mark directory/file conflict tests with REFFILES
  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 18:20 ` [PATCH v2] " Han-Wen Nienhuys via GitGitGadget
  1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2021-11-26  7:39 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys

"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:

> -test_expect_success 'D/F conflict prevents add long + delete short' '
> +test_expect_success REFFILES  'D/F conflict prevents add long + delete short' '

Two spaces after REFFILES here but ...

>  	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' '

... only one space here and then ...

>  	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' '

... two spaces here?  Let's be consistent.

>  	df_test refs/df-dl-as --del-add foo/bar foo
>  '

As all these df_test instances _expect_ to fail, not causing any
changes in the refs, I think skipping them would hopefully not
reveal unpleasant reliance of side effects by later tests.

And presumably, without REFFILES prerequisite, these operations
would be supported?  E.g. we can have 'main' branch, with 'main/1',
'main/2',... refs, at the same time, with reftable?  That would be
quite interesting.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] t1404: mark directory/file conflict tests with REFFILES
  2021-11-26  7:39 ` Junio C Hamano
@ 2021-11-29 10:57   ` Han-Wen Nienhuys
  2021-11-29 17:59     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Han-Wen Nienhuys @ 2021-11-29 10:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Fri, Nov 26, 2021 at 8:39 AM Junio C Hamano <gitster@pobox.com> wrote:

> And presumably, without REFFILES prerequisite, these operations
> would be supported?  E.g. we can have 'main' branch, with 'main/1',
> 'main/2',... refs, at the same time, with reftable?  That would be
> quite interesting.

The storage format allows D/F conflicts, but transactions are checked
for not creating new D/F conflicts (depending on
the value of reftable_write_options.skip_name_check).

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--
Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] t1404: mark directory/file conflict tests with REFFILES
  2021-11-29 10:57   ` Han-Wen Nienhuys
@ 2021-11-29 17:59     ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2021-11-29 17:59 UTC (permalink / raw)
  To: Han-Wen Nienhuys; +Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

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

> On Fri, Nov 26, 2021 at 8:39 AM Junio C Hamano <gitster@pobox.com> wrote:
>
>> And presumably, without REFFILES prerequisite, these operations
>> would be supported?  E.g. we can have 'main' branch, with 'main/1',
>> 'main/2',... refs, at the same time, with reftable?  That would be
>> quite interesting.
>
> The storage format allows D/F conflicts, but transactions are checked
> for not creating new D/F conflicts (depending on
> the value of reftable_write_options.skip_name_check).

OK.  Then once we let reffiles wither and die over time, hopefully
we can flip the bit and allow us to be in an interesting world ;-)

Nice.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] t1404: mark directory/file conflict tests with REFFILES
  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 18:20 ` Han-Wen Nienhuys via GitGitGadget
  1 sibling, 0 replies; 5+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-11-29 18:20 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-29 22:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v2] " Han-Wen Nienhuys via GitGitGadget

Code repositories for project(s) associated with this 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).