git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH 1/2] t1415: avoid using `main` as ref name
Date: Thu, 8 Oct 2020 09:56:59 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2010080923010.50@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20201005095448.GN1166820@google.com>

Hi Jonathan,

On Mon, 5 Oct 2020, Jonathan Nieder wrote:

>
> Johannes Schindelin wrote:
>
> > In preparation for a patch series that will change the fall-back for
> > `init.defaultBranch` to `main`, let's not use `main` as ref name in
> > this test script.
>
> Interesting.  I assume the issue is this line?
>
> 	-	git -C fer1/repo for-each-ref --format="%(refname)" | grep main >actual &&
>
> I.e., it's not actually that naming a worktree "main" will break
> anything, but just that the test catches refs/heads/main in the same
> net when it does grepping?

Right.

> If the commit message explains that, then this patch looks good to me.
> Without such an explanation, it would make me fear that we have some
> underlying bug in "git worktree".

Indeed. This is my current revision of the commit message:

    t1415: avoid using `main` as ref name

    In preparation for a patch series that will change the fall-back for
    `init.defaultBranch` to `main`, let's not use `main` as ref name in this
    test script.

    Otherwise, the `git for-each-ref ... | grep main` which wants to catch
    those refs would also unexpectedly catch `refs/heads/main`.

    Since the refs in question are worktree-local ones (i.e. each worktree
    has their own, just like `HEAD`), and since the test case already uses a
    secondary worktree called "second", let's use the name "first" for those
    refs instead.

    While at it, adjust the test titles that talk about a "repo" when they
    meant a "worktree" instead.

Ciao,
Dscho

  reply	other threads:[~2020-10-08  7:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05  8:56 [PATCH 0/2] Avoid main as branch name in the test suite Johannes Schindelin via GitGitGadget
2020-10-05  8:56 ` [PATCH 1/2] t1415: avoid using `main` as ref name Johannes Schindelin via GitGitGadget
2020-10-05  9:54   ` Jonathan Nieder
2020-10-08  7:56     ` Johannes Schindelin [this message]
2020-10-05  8:56 ` [PATCH 2/2] tests: avoid using the branch name `main` Johannes Schindelin via GitGitGadget
2020-10-05  9:59   ` Jonathan Nieder
2020-10-08  8:05     ` Johannes Schindelin
2020-10-08 18:15       ` Derrick Stolee
2020-10-08 10:13 ` [PATCH v2 0/2] Avoid main as branch name in the test suite Johannes Schindelin via GitGitGadget
2020-10-08 10:13   ` [PATCH v2 1/2] t1415: avoid using `main` as ref name Johannes Schindelin via GitGitGadget
2020-10-08 10:13   ` [PATCH v2 2/2] tests: avoid using the branch name `main` Johannes Schindelin via GitGitGadget

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=nycvar.QRO.7.76.6.2010080923010.50@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=jrnieder@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 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 NNTP newsgroup(s).