git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Jeff King <peff@peff.net>, git@vger.kernel.org
Cc: Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH] t/perf: handle worktrees as test repos
Date: Tue, 16 Feb 2021 15:36:04 -0500	[thread overview]
Message-ID: <22378ce3-6845-1cd9-996a-8bdc3a8b65d7@gmail.com> (raw)
In-Reply-To: <YCwoOMo7obrNOGYX@coredump.intra.peff.net>

On 2/16/2021 3:16 PM, Jeff King wrote:
> On Tue, Feb 16, 2021 at 03:12:45PM -0500, Jeff King wrote:
> 
>> Having written that, it occurs to me that an even simpler solution is to
>> just always use the commondir as the source of the scratch repo. It does
>> not produce the same outcome, but the point is generally just to find a
>> suitable starting point for a repository. Grabbing the main repo instead
>> of one of its worktrees is probably OK for most tests.
> 
> The patch there is delightfully simple:

I do like this simplicity.
 
> diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
> index e385c6896f..7018256cd4 100644
> --- a/t/perf/perf-lib.sh
> +++ b/t/perf/perf-lib.sh
> @@ -75,7 +75,7 @@ test_perf_create_repo_from () {
>  	BUG "not 2 parameters to test-create-repo"
>  	repo="$1"
>  	source="$2"
> -	source_git="$("$MODERN_GIT" -C "$source" rev-parse --git-dir)"
> +	source_git="$("$MODERN_GIT" -C "$source" rev-parse --git-common-dir)"
>  	objects_dir="$("$MODERN_GIT" -C "$source" rev-parse --git-path objects)"
>  	mkdir -p "$repo/.git"
>  	(
> 
> but I do wonder if somebody would find it confusing.

It would be confusing, especially if one let the "main" worktree
languish far behind another worktree. Rather, one case that applies
mostly to me and my team is when we work on git-for-windows/git or
microsoft/git in a worktree off of git/git. I think it would be
appropriate to use either, as the differences at HEAD are not so
significant to matter. But, any deviation from the HEAD of the
current worktree might be confusing when trying to reproduce some
surprising behavior.

Thanks,
-Stolee

  reply	other threads:[~2021-02-16 20:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 20:12 [PATCH] t/perf: handle worktrees as test repos Jeff King
2021-02-16 20:16 ` Jeff King
2021-02-16 20:36   ` Derrick Stolee [this message]
2021-02-16 22:52   ` Junio C Hamano
2021-02-16 22:56     ` Jeff King
2021-02-16 21:13 ` Johannes Schindelin
2021-02-16 21:38   ` Jeff King
2021-02-26  7:09 ` [PATCH v2] t/perf worktree improvements Jeff King
2021-02-26  7:11   ` [PATCH v2 1/2] t/perf: handle worktrees as test repos Jeff King
2021-02-26  7:13   ` [PATCH v2 2/2] t/perf: avoid copying worktree files from test repo Jeff King
2021-02-26 15:43   ` [PATCH v2] t/perf worktree improvements Derrick Stolee
2021-03-01 22:03     ` Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=22378ce3-6845-1cd9-996a-8bdc3a8b65d7@gmail.com \
    --to=stolee@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).