diff mbox series

[v3,03/12] t1092: expand repository data shape

Message ID 70971b1f9261f2623ad6d6393be1a8e191003eb4.1621017072.git.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Headers show
Series Sparse-index: integrate with status | expand

Commit Message

Derrick Stolee May 14, 2021, 6:31 p.m. UTC
From: Derrick Stolee <dstolee@microsoft.com>

As more features integrate with the sparse-index feature, more and more
special cases arise that require different data shapes within the tree
structure of the repository in order to demonstrate those cases.

Add several interesting special cases all at once instead of sprinkling
them across several commits. The interesting cases being added here are:

* Add sparse-directory entries on both sides of directories within the
  sparse-checkout definition.

* Add directories outside the sparse-checkout definition who have only
  one entry and are the first entry of a directory with multiple
  entries.

Later tests will take advantage of these shapes, but they also deepen
the tests that already exist.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 t/t1092-sparse-checkout-compatibility.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Elijah Newren May 18, 2021, 1:49 a.m. UTC | #1
On Fri, May 14, 2021 at 11:31 AM Derrick Stolee via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Derrick Stolee <dstolee@microsoft.com>
>
> As more features integrate with the sparse-index feature, more and more
> special cases arise that require different data shapes within the tree
> structure of the repository in order to demonstrate those cases.
>
> Add several interesting special cases all at once instead of sprinkling
> them across several commits. The interesting cases being added here are:
>
> * Add sparse-directory entries on both sides of directories within the
>   sparse-checkout definition.
>
> * Add directories outside the sparse-checkout definition who have only
>   one entry and are the first entry of a directory with multiple
>   entries.
>
> Later tests will take advantage of these shapes, but they also deepen
> the tests that already exist.

Makes sense.  Do we also want to add ones of the form

   foo/bar
   foo.txt

?

Here we'd be particularly looking that if foo is a sparse directory,
we want to avoid messing up its order.  ('foo' sorts before 'foo.txt',
but 'foo/' sorts after, and thus 'foo' the directory should be after
'foo.txt')


> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
> ---
>  t/t1092-sparse-checkout-compatibility.sh | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh
> index 4f2f09b53a32..98257695979a 100755
> --- a/t/t1092-sparse-checkout-compatibility.sh
> +++ b/t/t1092-sparse-checkout-compatibility.sh
> @@ -17,7 +17,7 @@ test_expect_success 'setup' '
>                 echo "after folder1" >g &&
>                 echo "after x" >z &&
>                 mkdir folder1 folder2 deep x &&
> -               mkdir deep/deeper1 deep/deeper2 &&
> +               mkdir deep/deeper1 deep/deeper2 deep/before deep/later &&
>                 mkdir deep/deeper1/deepest &&
>                 echo "after deeper1" >deep/e &&
>                 echo "after deepest" >deep/deeper1/e &&
> @@ -25,10 +25,16 @@ test_expect_success 'setup' '
>                 cp a folder2 &&
>                 cp a x &&
>                 cp a deep &&
> +               cp a deep/before &&
>                 cp a deep/deeper1 &&
>                 cp a deep/deeper2 &&
> +               cp a deep/later &&
>                 cp a deep/deeper1/deepest &&
>                 cp -r deep/deeper1/deepest deep/deeper2 &&
> +               mkdir deep/deeper1/0 &&
> +               mkdir deep/deeper1/0/0 &&
> +               touch deep/deeper1/0/1 &&
> +               touch deep/deeper1/0/0/0 &&
>                 git add . &&
>                 git commit -m "initial commit" &&
>                 git checkout -b base &&
> --
> gitgitgadget

Looks good.
Derrick Stolee May 18, 2021, 2:59 p.m. UTC | #2
On 5/17/2021 9:49 PM, Elijah Newren wrote:
> On Fri, May 14, 2021 at 11:31 AM Derrick Stolee via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>> Later tests will take advantage of these shapes, but they also deepen
>> the tests that already exist.
> 
> Makes sense.  Do we also want to add ones of the form
> 
>    foo/bar
>    foo.txt
> 
> ?
> 
> Here we'd be particularly looking that if foo is a sparse directory,
> we want to avoid messing up its order.  ('foo' sorts before 'foo.txt',
> but 'foo/' sorts after, and thus 'foo' the directory should be after
> 'foo.txt')

Good idea!

Thanks,
-Stolee
diff mbox series

Patch

diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh
index 4f2f09b53a32..98257695979a 100755
--- a/t/t1092-sparse-checkout-compatibility.sh
+++ b/t/t1092-sparse-checkout-compatibility.sh
@@ -17,7 +17,7 @@  test_expect_success 'setup' '
 		echo "after folder1" >g &&
 		echo "after x" >z &&
 		mkdir folder1 folder2 deep x &&
-		mkdir deep/deeper1 deep/deeper2 &&
+		mkdir deep/deeper1 deep/deeper2 deep/before deep/later &&
 		mkdir deep/deeper1/deepest &&
 		echo "after deeper1" >deep/e &&
 		echo "after deepest" >deep/deeper1/e &&
@@ -25,10 +25,16 @@  test_expect_success 'setup' '
 		cp a folder2 &&
 		cp a x &&
 		cp a deep &&
+		cp a deep/before &&
 		cp a deep/deeper1 &&
 		cp a deep/deeper2 &&
+		cp a deep/later &&
 		cp a deep/deeper1/deepest &&
 		cp -r deep/deeper1/deepest deep/deeper2 &&
+		mkdir deep/deeper1/0 &&
+		mkdir deep/deeper1/0/0 &&
+		touch deep/deeper1/0/1 &&
+		touch deep/deeper1/0/0/0 &&
 		git add . &&
 		git commit -m "initial commit" &&
 		git checkout -b base &&