"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: Defaulting primary branch name to "main"
To:
Kurt Mosiejczuk <kurt@cranky.work>
Cc:
gameoftrees <gameoftrees@openbsd.org>
Date:
Tue, 29 Oct 2019 19:02:49 +0100

Download raw body.

Thread
On Tue, Oct 29, 2019 at 01:24:01PM -0400, Kurt Mosiejczuk wrote:
> OpenBSD cvs works on the "MAIN" branch by default. This diff moves got
> to using "main" by default rather than "master". As a side benefit, it
> also avoids using the potentially loaded term "master".

I am fine with this change. Apart from the negative connotations of
the terminology, promoting the idea that branch names are always chosen
by convention is good. Having a different default branch name than Git
helps to spread the idea that branch names aren't necessarily the same
everywhere.

> I'm having trouble with the regression test test_import_requires_new_branch.
> I'm not seeing why it fails. I did verify it doesn't fail before my changes
> though. Maybe someone can point out what I broke.

The test assumes that the repository created by the test_init() function
contains a 'master' branch which will collide with the default 'master'
branch which is used by got import without your patch.
You can either modify the test to pass '-b master' to 'got import',
or add a 'main' branch in the Git repository at the beginning of the test,
or perhaps even modify test_init() to create a 'main' branch instead of
'master' in all tests (which might cause additional test fallout).

Regarding the man page changes:

> -Fetch new upstream commits into the local repository's master branch.
> +Fetch new upstream commits into the local repository's main branch.
>  This step currently requires
>  .Xr git 1 :
>  .Pp
>  .Dl $ cd /var/git/src.git
> -.Dl $ git fetch origin master:master
> +.Dl $ git fetch origin main:main

Assuming that people use these instructions verbatim when trying to work
against the openbsd src.git repo from github, this command will now fail.

Should we adjust all examples, or just some of them?
Should the examples just keep using 'master' throughout?
I am not sure.

>  Before outgoing changes on the local
> -.Dq master
> +.Dq main
> branch can be pushed to the remote repository, the local
> -.Dq master
> +.Dq main
>  branch must be rebased onto the
> -.Dq origin/master
> +.Dq origin/main
>  branch:
>  .Pp
> -.Dl $ got update -b origin/master
> -.Dl $ got rebase master
> +.Dl $ got update -b origin/main
> +.Dl $ got rebase main

Same here.