git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] t1415: avoid using `main` as ref name

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 8, 2020, 07:56 UTC
Message-ID
<nycvar.QRO.7.76.6.2010080923010.50@tvgsbejvaqbjf.bet>
In-Reply-To
<20201005095448.GN1166820@google.com>
Hi Jonathan,
On Mon, 5 Oct 2020, Jonathan Nieder wrote:
Show 14 quoted lines
>
> 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

Previous: Jonathan NiederNext: Johannes Schindelin via GitGitGadget
Message 4 of 11 in “Avoid main as branch name in the test suite”
  1. 0/2 Avoid main as branch name in the test suiteJohannes Schindelin via GitGitGadget, Oct 5, 2020
  2. 1/2 t1415: avoid using `main` as ref nameJohannes Schindelin via GitGitGadget, Oct 5, 2020
  3. Jonathan NiederOct 5, 2020
  4. Johannes SchindelinOct 8, 2020
  5. 2/2 tests: avoid using the branch name `main`Johannes Schindelin via GitGitGadget, Oct 5, 2020
  6. Jonathan NiederOct 5, 2020
  7. Johannes SchindelinOct 8, 2020
  8. Derrick StoleeOct 8, 2020
  9. 0/2 Avoid main as branch name in the test suiteJohannes Schindelin via GitGitGadget, Oct 8, 2020
  10. 1/2 t1415: avoid using `main` as ref nameJohannes Schindelin via GitGitGadget, Oct 8, 2020
  11. 2/2 tests: avoid using the branch name `main`Johannes Schindelin via GitGitGadget, Oct 8, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.