git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 30, 2023, 14:57 UTC
Message-ID
<xmqq1ql64796.fsf@gitster.g>
In-Reply-To
<pull.1480.v3.git.git.1680155957146.gitgitgadget@gmail.com>
"Raghul Nanth A via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Raghul Nanth A <nanth.raghul@gmail.com>
>
> Add usage and performance tests for describe
I think this sentence can easily go.
> Describe uses the index when it is run with --dirty flag, which uses the
> run_diff_index commmand. The command is sparse-index aware and hence we
> can just set the requires-full-index to false

End the sentence with full-stop. More importantly, it would be nicer to have something to substantiate the "this is sparse aware" claim here, something like "since commit X" or "as shown in the test tXXXX.YY".

Updated tests do look good, and the code change is of course minimal and to the point, which is also good.

Thanks.
Show 51 quoted lines
> diff --git a/t/perf/p2000-sparse-operations.sh b/t/perf/p2000-sparse-operations.sh
> index 3242cfe91a0..db7887470f9 100755
> --- a/t/perf/p2000-sparse-operations.sh
> +++ b/t/perf/p2000-sparse-operations.sh
> @@ -43,6 +43,7 @@ test_expect_success 'setup repo and indexes' '
>  	done &&
>  
>  	git sparse-checkout init --cone &&
> +	git tag -a v1.0 -m "Final" &&
>  	git sparse-checkout set $SPARSE_CONE &&
>  	git checkout -b wide $OLD_COMMIT &&
>  
> @@ -125,5 +126,7 @@ test_perf_on_all git checkout-index -f --all
>  test_perf_on_all git update-index --add --remove $SPARSE_CONE/a
>  test_perf_on_all "git rm -f $SPARSE_CONE/a && git checkout HEAD -- $SPARSE_CONE/a"
>  test_perf_on_all git grep --cached --sparse bogus -- "f2/f1/f1/*"
> +test_perf_on_all git describe --dirty
> +test_perf_on_all 'echo >>new && git describe --dirty'
>  
>  test_done
> 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
> +	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
> +'
> +
>  test_expect_success 'sparse index is not expanded: diff' '
>  	init_repos &&
>  
>
> base-commit: 27d43aaaf50ef0ae014b88bba294f93658016a2e
Previous: Raghul Nanth A via GitGitGadgetNext: Junio C Hamano
Message 13 of 21 in “describe: enable sparse index for describe”
  1. describe: enable sparse index for describeRaghul Nanth A via GitGitGadget, Mar 27, 2023
  2. Junio C HamanoMar 27, 2023
  3. Derrick StoleeMar 28, 2023
  4. Junio C HamanoMar 28, 2023
  5. Derrick StoleeMar 28, 2023
  6. describe: enable sparse index for describeRaghul Nanth A via GitGitGadget, Mar 29, 2023
  7. Junio C HamanoMar 29, 2023
  8. Victoria DyeMar 29, 2023
  9. Junio C HamanoMar 29, 2023
  10. Raghul NanthMar 30, 2023
  11. Victoria DyeApr 3, 2023
  12. describe: enable sparse index for describeRaghul Nanth A via GitGitGadget, Mar 30, 2023
  13. Junio C HamanoMar 30, 2023
  14. Junio C HamanoMar 30, 2023
  15. Victoria DyeMar 30, 2023
  16. [GSOC][PATCH] describe: enable sparse index for describeRaghul Nanth A, Mar 31, 2023
  17. Junio C HamanoMar 31, 2023
  18. [GSOC][PATCH v4] describe: enable sparse index for describeRaghul Nanth A, Mar 31, 2023
  19. Victoria DyeApr 3, 2023
  20. [GSOC][PATCH v5] describe: enable sparse index for describeRaghul Nanth A, Apr 3, 2023
  21. describe: enable sparse index for describeRaghul Nanth A, Apr 3, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.