Subject: Re: [PATCH v3] describe: enable sparse index for describe

From: Victoria Dye <[email-masked]>
Date: Thu, 30 Mar 2023 09:23:38 -0700

Raghul Nanth A via GitGitGadget wrote:
> diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh
> index 801919009e1..8bc35c51426 100755
> --- a/t/t1092-sparse-checkout-compatibility.sh
> +++ b/t/t1092-sparse-checkout-compatibility.sh
> @@ -1514,6 +1514,24 @@ test_expect_success 'sparse-index is not expanded: stash' '
>  	ensure_not_expanded stash pop
>  '
>  
> +test_expect_success 'sparse-index is not expanded: describe' '
> +	init_repos &&
> +	# Add tag to be read by describe

Please add newlines before these comments to visually space out the test &
make it more readable.

> +	git -C sparse-index tag -a v1.0 -m "Version 1" &&
> +	ensure_not_expanded describe --dirty &&
> +	cp sparse-index-out sparse-index-dirty &&
> +	ensure_not_expanded describe &&
> +	cp sparse-index-out sparse-index-normal &&
> +	# Check describe has same output on clean tree
> +	test_cmp sparse-index-dirty sparse-index-normal &&
> +	echo "test" >>sparse-index/g &&
> +	ensure_not_expanded describe --dirty &&
> +	echo "v1.0-dirty" > actual &&
> +	# Check describe on dirty work tree
> +	test_cmp sparse-index-out actual &&
> +	ensure_not_expanded describe

Sorry if I was unclear in my last review [1], but I did not mean that you
should add cases to this test (and, to be honest, the comparison of
'sparse-index-dirty' and 'sparse-index-normal' doesn't add much here).
Please add separate tests (as in, full 'test_expect_success' blocks) for
checking that the functionality of 'git describe' is consistent across
'full-checkout', 'sparse-checkout', and 'sparse-index'. Past sparse index
integrations ('git grep' [2], 'git read-tree' [3], 'git show' [4], etc.) are
a good reference for the types of tests that should be added.

[1] https://lore.kernel.org/git/[email-masked]/
[2] https://lore.kernel.org/git/[email-masked]/
[3] https://lore.kernel.org/git/90eb[email-masked]/
[4] https://lore.kernel.org/git/8c2f[email-masked]/

> +'
> +
>  test_expect_success 'sparse index is not expanded: diff' '
>  	init_repos &&
>  
> 
> base-commit: 27d43aaaf50ef0ae014b88bba294f93658016a2e