All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Raghul Nanth A via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Derrick Stolee <derrickstolee@github.com>,
	Raghul Nanth A <nanth.raghul@gmail.com>
Subject: Re: [PATCH v2] describe: enable sparse index for describe
Date: Wed, 29 Mar 2023 10:00:02 -0700	[thread overview]
Message-ID: <xmqq355nbii5.fsf@gitster.g> (raw)
In-Reply-To: <pull.1480.v2.git.git.1680107154078.gitgitgadget@gmail.com> (Raghul Nanth A. via GitGitGadget's message of "Wed, 29 Mar 2023 16:25:53 +0000")

"Raghul Nanth A via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Raghul Nanth A <nanth.raghul@gmail.com>
>
> Add usage and performance tests for describe
>
> Performance metrics
> ...

The description is a bit skimpy.  At least it should explain why
blindly flipping the "requires-full-index" bit off is all that is
necessary. I think in the review discussion on v1, Derrick gave some
explanation you can regurgitate and reuse.

> Signed-off-by: Raghul Nanth A <nanth.raghul@gmail.com>
> ...

> diff --git a/t/t6121-describe-sparse.sh b/t/t6121-describe-sparse.sh
> new file mode 100755
> index 00000000000..ce53603c387
> --- /dev/null
> +++ b/t/t6121-describe-sparse.sh
> @@ -0,0 +1,67 @@
> +#!/bin/sh
> +
> +test_description='git describe in sparse checked out trees'
> +
> +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
> +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> +
> +. ./test-lib.sh
> +
> +check_describe () {
> +	indir= &&
> +...
> +	'
> +}

Having this almost identical helper copied from a near-by test
script means maintenance nightmare.  People will forget to side port
to this copy any fixes they make to the other one.

I was hoping there would be a cleaner approach to reuse t6120, by
doing something similar to either how t8001-annotate shares blame
tests, or how t5559 takes advantage of t5551.  One way might be ...

 * prepare a prerequisite like so near the beginning of t6120

	test_lazy_prereq WITH_SPARSE_INDEX '
		test "$TEST_NAME" = t6121-describe
	'

 * add tests to be run with sparse-index enabled, but guarded with
   some variable, e.g.

	test_expect_success TESTING_SPARSE_INDEX 'a new test' '
		... do sparse-index testing specific code ...
	'

   Such "sparse-index testing specific" code may include turning the
   working tree the previous test already prepared into sparse
   (i.e. additional "setup"), or running commands under
   "ensure_not_expanded" (i.e. new tests).

 * create t6121 that works similar to how t5559 takes advantage of
   t5551, something like

	#/bin/sh
	. ./t6120-describe.sh

Ideally we should be able to do this without adding a new t6121, by
adding new tests that are specific to sparse-index at the end of
t6120, and avoid duplicated code.

Another possibility that may take the least amount of effort (but
may give us a lot less satisfactory outcome) may be to add a
lib-describe.sh library that is sourced from t6120 and t6121, and
move check_describe there.  If check_describe has to behave slightly
differently, have a new conditional in the implementation so that
the caller can make a choice.



  reply	other threads:[~2023-03-29 17:00 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 [this message]
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
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=xmqq355nbii5.fsf@gitster.g \
    --to=gitster@pobox.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.