All of lore.kernel.org
 help / color / mirror / Atom feed
From: Victoria Dye <vdye@github.com>
To: Raghul Nanth A <nanth.raghul@gmail.com>, gitgitgadget@gmail.com
Cc: derrickstolee@github.com, git@vger.kernel.org
Subject: Re: [GSOC][PATCH v4] describe: enable sparse index for describe
Date: Mon, 3 Apr 2023 09:34:10 -0700	[thread overview]
Message-ID: <f8d8ed7f-49cd-d65a-521c-e03d2c552c50@github.com> (raw)
In-Reply-To: <20230331182038.224892-1-nanth.raghul@gmail.com>

Raghul Nanth A wrote:
> git describe compares the index with the working tree when (and only
> when) it is run with the "--dirty" flag. This is done by the
> run_diff_index() function. The function has been made aware of the
> sparse-index in the series that led to 8d2c3732 (Merge branch
> 'ld/sparse-diff-blame', 2021-12-21). Hence we can just set the
> requires-full-index to false for "describe".
> 

This is a good description of the patch and the reasoning behind the
changes.

> diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh
> index 801919009e..2b46fb2a48 100755
> --- a/t/t1092-sparse-checkout-compatibility.sh
> +++ b/t/t1092-sparse-checkout-compatibility.sh
> @@ -1514,6 +1514,36 @@ test_expect_success 'sparse-index is not expanded: stash' '
>  	ensure_not_expanded stash pop
>  '
>  
> +test_expect_success 'describe tested on all' '
> +	init_repos &&
> +
> +	# Add tag to be read by describe
> +
> +	run_on_all git tag -a v1.0 -m "Version 1" &&
> +	test_all_match git describe --dirty &&
> +	run_on_all rm g &&
> +	test_all_match git describe --dirty
> +'
> +
> +
> +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 &&
> +	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 &&

This type of output comparison should be part of 'describe tested on all',
not the "ensure not expanded" test; the former tests the correctness of 'git
describe', whereas the latter focuses on index expansion. When unit testing,
it helps to keep the scope of each test fairly narrow with a specific focus
so that they can more easily isolate future regressions.

> +	ensure_not_expanded describe
> +'
> +
>  test_expect_success 'sparse index is not expanded: diff' '
>  	init_repos &&
>  


  reply	other threads:[~2023-04-03 16:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 14:20 [PATCH] describe: enable sparse index for describe Raghul Nanth A via GitGitGadget
2023-03-27 18:26 ` Junio C Hamano
2023-03-28 19:46   ` Derrick Stolee
2023-03-28 20:24     ` Junio C Hamano
2023-03-28 20:35       ` Derrick Stolee
2023-03-29 16:25 ` [PATCH v2] " Raghul Nanth A via GitGitGadget
2023-03-29 17:00   ` Junio C Hamano
2023-03-29 17:49   ` Victoria Dye
2023-03-29 18:27     ` Junio C Hamano
2023-03-30 16:10     ` Raghul Nanth
2023-04-03 16:37       ` Victoria Dye
2023-03-30  5:59   ` [PATCH v3] " Raghul Nanth A via GitGitGadget
2023-03-30 14:57     ` Junio C Hamano
2023-03-30 15:13       ` Junio C Hamano
2023-03-30 16:23     ` Victoria Dye
2023-03-31 15:43       ` [GSOC][PATCH] " Raghul Nanth A
2023-03-31 16:34         ` Junio C Hamano
2023-03-31 18:20     ` [GSOC][PATCH v4] " Raghul Nanth A
2023-04-03 16:34       ` Victoria Dye [this message]
2023-04-03 16:47       ` [GSOC][PATCH v5] " Raghul Nanth A
2023-04-03  7:35     ` [PATCH v4] " Raghul Nanth A

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8d8ed7f-49cd-d65a-521c-e03d2c552c50@github.com \
    --to=vdye@github.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=nanth.raghul@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.