From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9DA2C433E9 for ; Tue, 16 Feb 2021 20:17:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A2C864E7A for ; Tue, 16 Feb 2021 20:17:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230100AbhBPURp (ORCPT ); Tue, 16 Feb 2021 15:17:45 -0500 Received: from cloud.peff.net ([104.130.231.41]:34888 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbhBPURi (ORCPT ); Tue, 16 Feb 2021 15:17:38 -0500 Received: (qmail 14726 invoked by uid 109); 16 Feb 2021 20:16:57 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 16 Feb 2021 20:16:57 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 28960 invoked by uid 111); 16 Feb 2021 20:16:56 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 16 Feb 2021 15:16:56 -0500 Authentication-Results: peff.net; auth=none Date: Tue, 16 Feb 2021 15:16:56 -0500 From: Jeff King To: git@vger.kernel.org Cc: Derrick Stolee Subject: Re: [PATCH] t/perf: handle worktrees as test repos Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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: 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. -Peff