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

Re: [PATCH 2/2] tests: avoid using the branch name `main`

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 5, 2020, 09:59 UTC
Message-ID
<20201005095930.GO1166820@google.com>
In-Reply-To
<6045ceb938836355b7d43bc2088ca2504b05dde4.1601888196.git.gitgitgadget@gmail.com>
Johannes Schindelin wrote:
Show 22 quoted lines
> In the near future, we want to change Git's default branch name to
> `main`. In preparation for that, stop using it as a branch name in the
> test suite. Replace that branch name by `primary`.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  t/t6012-rev-list-simplify.sh |  8 ++++----
>  t/t6400-merge-df.sh          |  8 ++++----
>  t/t6409-merge-subtree.sh     | 12 ++++++------
>  t/t6430-merge-recursive.sh   |  4 ++--
>  4 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh
> index b6fa43ace0..f1296c29e6 100755
> --- a/t/t6012-rev-list-simplify.sh
> +++ b/t/t6012-rev-list-simplify.sh
> @@ -171,7 +171,7 @@ test_expect_success '--full-diff is not affected by --parents' '
>  test_expect_success 'rebuild repo' '
>  	rm -rf .git * &&
>  	git init &&
> -	git switch -c main &&
> +	git switch -c primary &&
Is there a secondary corresponding to this primary?

I guess the idea is that this is the trunk that other branches branch from? Looking at the history, it seems that this test was added relatively recently and it may have had the upcoming branch name change in mind (or in other words if it were an older test it might be expected to use "master").

That suggests an alternative that is agnostic to init.defaultBranch: what if this uses "git switch -C main"?

Thanks, Jonathan

Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin
Message 6 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.