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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jonathan,

On Mon, 5 Oct 2020, Jonathan Nieder wrote:

> Johannes Schindelin wrote:
>
> > 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@xxxxxx>
> > ---
> >  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?

Nope, of course not ;-)

> 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").

I guess that Stolee (Cc:ed) had something like that in mind.

When I look at 8d049e182e2 (revision: --show-pulls adds helpful
merges, 2020-04-10), I get the impression that does not _really_ care
about the name of the main branch, it just wants to know the name so it
can switch back and forth.

If I had had the presence of mind when reviewing that patch back in April,
I would probably have advocated for the use of `git switch -`...

In any case, I would like to keep this consistent with the remainder of
the test scripts modified by this patch, and use the relatively neutral
`topic` here.

Ciao,
Dscho

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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux