threads / discuss / 55028

Can git change?

Subject: Can git change?

## tl;dr

12 messages between Jan 22, 2021 and Mar 10, 2021.

replies: 11people: 6as markdown or json

Patricia B. C.· Jan 22, 2021, 12:59 UTC · lore

Hello! My name is Patricia and I work as a software engineer in Brazil. I also teach sometimes at Le Wagon, a programming school. I brought the discussion about changing our repositories' branch to main instead of master. The response of one of the owners was that "Git has not changed it, so we will not change". So here I was, wondering if maybe Git would hear me out :) Do you have any thoughts on it?

Thank you! Best regards, Patricia Camiansky.

Christian Couder· Jan 22, 2021, 13:31 UTC · re: Patricia B. C. · lore

Re: Can git change?

Hi,
On Fri, Jan 22, 2021 at 2:05 PM Patricia B. C. <pati.camsky@gmail.com> wrote:
Show 9 quoted lines
>
> Hello!
> My name is Patricia and I work as a software engineer in Brazil. I
> also teach sometimes at Le Wagon, a programming school.
> I brought the discussion about changing our repositories' branch to
> main instead of master. The response of one of the owners was that
> "Git has not changed it, so we will not change". So here I was,
> wondering if maybe Git would hear me out :)
> Do you have any thoughts on it?

There have been a lot of discussions about this topic. You can find some pointers to them (though maybe not the most recent ones) in the article "The history of `master` in Git" in:

https://git.github.io/rev_news/2020/07/29/edition-65/

There has been also an official statement by the Conservancy and the Git PLC (Project Leadership Committee):

https://sfconservancy.org/news/2020/jun/23/gitbranchname/

Best, Christian.

Junio C Hamano· Jan 22, 2021, 18:46 UTC · re: Christian Couder · lore

Re: Can git change?

Christian Couder <christian.couder@gmail.com> writes:
Show 23 quoted lines
> Hi,
>
> On Fri, Jan 22, 2021 at 2:05 PM Patricia B. C. <pati.camsky@gmail.com> wrote:
>>
>> Hello!
>> My name is Patricia and I work as a software engineer in Brazil. I
>> also teach sometimes at Le Wagon, a programming school.
>> I brought the discussion about changing our repositories' branch to
>> main instead of master. The response of one of the owners was that
>> "Git has not changed it, so we will not change". So here I was,
>> wondering if maybe Git would hear me out :)
>> Do you have any thoughts on it?
>
> There have been a lot of discussions about this topic. You can find
> some pointers to them (though maybe not the most recent ones) in the
> article "The history of `master` in Git" in:
>
> https://git.github.io/rev_news/2020/07/29/edition-65/
>
> There has been also an official statement by the Conservancy and the
> Git PLC (Project Leadership Committee):
>
> https://sfconservancy.org/news/2020/jun/23/gitbranchname/

I got an impression that Patricia wanted to follow what we do to this project, but AFAIU, both of the above are about what Git does to help end-user projects to rename. They do not talk about what branch this project uses.

A much more relevant direct reference is the brian's assessment for us to switch in Edition 65, plus the test clean-up series from Dscho.

Having said all that, imitating what we do to our project may probably not be a good idea. We have done, and we will do in the future, experimental things, some of which may turn out to be bad ideas [*1*]. The users are probably better off imitating projects with larger developer base.

[Footnote]
*1* subtree merging of gitk and git-gui, for an example, and having
    an octopus merge in the history is another.
Martin von Zweigbergk· Jan 22, 2021, 22:43 UTC · re: Junio C Hamano · lore

Re: Can git change?

On Fri, Jan 22, 2021 at 9:39 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> *1* subtree merging of gitk and git-gui, for an example, and having
>     an octopus merge in the history is another.

This is probably quite off topic for the thread, but I'm curious why you think it was a bad idea to have octopus merges in git.git's history (there seem to be 37 of them).

Junio C Hamano· Jan 23, 2021, 02:27 UTC · re: Martin von Zweigbergk · lore

Re: Can git change?

Martin von Zweigbergk <martinvonz@gmail.com> writes:
> This is probably quite off topic for the thread, but I'm curious why
> you think it was a bad idea to have octopus merges in git.git's
> history (there seem to be 37 of them).

Octoupi in our history, at least the older ones, solve no real life problem; it only gives us "now we have something cool-looking that other people's version control systems never had", which is of dubious value.

And their presense makes bisection less efficient than it could be around them, which is a real downside.

Patricia B. C.· Jan 23, 2021, 12:56 UTC · re: Junio C Hamano · lore

RES: Can git change?

Hey, thanks for the replies, guys.

Yes, as Junio said, my intention was to understand a bit about what you were doing, so thank you for the explanation!

The idea isn't really to imitate what you are doing, but just to use it as a benchmark to show that changing the name of the branch might not seem like an important thing, but it is a global movement that is being adopted by many renowned developers.

Quoting one of the comments on the discussion topic I raised:

"It's only the default name for repositories created inside GitHub. Since our students only create their repositories locally on their computers with Git, I don't see how GitHub's decision will affect them. If Git decides to change over from master to main, and there is an industry-wide push to adopt this change (which doesn't seem very likely to me), then I might agree with you"

So, I just wanted to show that guy that this is an industry-wide push :)

Best regards, Patricia Camiansky.

De: Junio C Hamano
Enviado:sexta-feira, 22 de janeiro de 2021 23:27
Para: Martin von Zweigbergk
Cc:Christian Couder; Patricia B. C.; git
Assunto: Re: Can git change?
Martin von Zweigbergk <martinvonz@gmail.com> writes:
> This is probably quite off topic for the thread, but I'm curious why
> you think it was a bad idea to have octopus merges in git.git's
> history (there seem to be 37 of them).
Octoupi in our history, at least the older ones, solve no real life
problem; it only gives us "now we have something cool-looking that
other people's version control systems never had", which is of
dubious value.
And their presense makes bisection less efficient than it could be
around them, which is a real downside.
Johannes Schindelin· Jan 25, 2021, 16:28 UTC · re: Patricia B. C. · lore

Re: RES: Can git change?

Hi Patricia,
On Sat, 23 Jan 2021, Patricia B. C. wrote:
Show 7 quoted lines
> Yes, as Junio said, my intention was to understand a bit about what
> you were doing, so thank you for the explanation!
>
> The idea isn't really to imitate what you are doing, but just to use
> it as a benchmark to show that changing the name of the branch might
> not seem like an important thing, but it is a global movement that is
> being adopted by many renowned developers.

FWIW Git for Windows switched all of its repositories to use `main` as default branch name: its git/git fork, the build-extra, MINGW-packages, MSYS2-packages, git-sdk-32, git-sdk-64, git-for-windows.github.io, msys2-runtime, busybox-w32 and WinToast repositories:

	https://github.com/git-for-windows/
Show 8 quoted lines
> Quoting one of the comments on the discussion topic I raised:
>
> "It's only the default name for repositories created inside GitHub.
> Since our students only create their repositories locally on their
> computers with Git, I don't see how GitHub's decision will affect
> them. If Git decides to change over from master to main, and there is
> an industry-wide push to adopt this change (which doesn't seem very
> likely to me), then I might agree with you"

Any repository created on GitHub will have that branch name by default. Likewise on Azure DevOps. I fully expect the other hosters to follow at some stage, and also for `git init` to change the default in a future version (I am working toward that goal).

And I have to admit that I am somewhat concerned about your students if one of their instructors thinks that their education shouldn't prepare them for more than working locally on their computers. Aren't they at all interested in preparing the students for life after university? If so, they will most certainly be affected by GitHub's decision.

> So, I just wanted to show that guy that this is an industry-wide push :)

Maybe Git itself is not a good example for that. Bigger projects face dramatically bigger challenges replacing the default branch name because of the short term disruption caused by it. Nevertheless, a growing number of projects have already renamed their default branch, such as Snowpack (https://github.com/snowpackjs/snowpack) and the react-refresh webpack plugin (https://github.com/pmmmwh/react-refresh-webpack-plugin) but also bigger ones such as LLVM (https://github.com/llvm/llvm-project).

Ciao, Johannes

Junio C Hamano· Jan 26, 2021, 01:58 UTC · re: Johannes Schindelin · lore

Re: RES: Can git change?

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
> And I have to admit that I am somewhat concerned about your students if
> one of their instructors thinks that their education shouldn't prepare
> them for more than working locally on their computers. Aren't they at all
> interested in preparing the students for life after university? If so,
> they will most certainly be affected by GitHub's decision.

GitHub's decision will most affect projects that haven't started yet, simply because they won't have to incur any "transition" cost the existing projects may have to consider. And given enough time, old projects die out and there will be more new projects than the projects we currently have, hopefully.

Until that happens, they would be affected more by decision by the projects they interact with, as it is most convenient if your local name matches the name the upstream uses. And the versions of Git way before people started talking about 'master' and 'main' have long been prepared for that, and we've been closing possible gaps in the recent versions. "git clone" would notice what name the upstream uses and uses the same name locally.

Even when they work locally, they'll start getting 'main' from their Git soon, and that would become consistent with the name that their "upstream" projects are likely to choose due to this "industry wide" push.

Show 12 quoted lines
> Any repository created on GitHub will have that branch name by default.
> Likewise on Azure DevOps. I fully expect the other hosters to follow at
> some stage, and also for `git init` to change the default in a future
> version (I am working toward that goal).
> ...
> Maybe Git itself is not a good example for that. Bigger projects face
> dramatically bigger challenges replacing the default branch name because
> of the short term disruption caused by it. Nevertheless, a growing number
> of projects have already renamed their default branch, such as Snowpack
> (https://github.com/snowpackjs/snowpack) and the react-refresh webpack
> plugin (https://github.com/pmmmwh/react-refresh-webpack-plugin) but also
> bigger ones such as LLVM (https://github.com/llvm/llvm-project).

Yes, thanks for giving Patricia and likeminded souls more usable ammunition than just us ;-)

Patricia B. C.· Jan 26, 2021, 12:32 UTC · re: Junio C Hamano · lore

Re: RES: Can git change?

Hey! Thank you very much, guys, for the detailed explanation, I will bring those points to the discussion topic :D I do agree with you that we should prepare the students for "real world" projects and not only working locally. Hopefully, there will be more people who agree with me than people who want to stick with the old fashioned way :)

Thanks again! Patricia Camiansky.

Em seg., 25 de jan. de 2021 às 22:58, Junio C Hamano <gitster@pobox.com> escreveu:

Show 44 quoted lines
>
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > And I have to admit that I am somewhat concerned about your students if
> > one of their instructors thinks that their education shouldn't prepare
> > them for more than working locally on their computers. Aren't they at all
> > interested in preparing the students for life after university? If so,
> > they will most certainly be affected by GitHub's decision.
>
> GitHub's decision will most affect projects that haven't started
> yet, simply because they won't have to incur any "transition" cost
> the existing projects may have to consider.  And given enough time,
> old projects die out and there will be more new projects than the
> projects we currently have, hopefully.
>
> Until that happens, they would be affected more by decision by the
> projects they interact with, as it is most convenient if your local
> name matches the name the upstream uses.  And the versions of Git
> way before people started talking about 'master' and 'main' have
> long been prepared for that, and we've been closing possible gaps in
> the recent versions.  "git clone" would notice what name the upstream
> uses and uses the same name locally.
>
> Even when they work locally, they'll start getting 'main' from their
> Git soon, and that would become consistent with the name that their
> "upstream" projects are likely to choose due to this "industry wide"
> push.
>
>
> > Any repository created on GitHub will have that branch name by default.
> > Likewise on Azure DevOps. I fully expect the other hosters to follow at
> > some stage, and also for `git init` to change the default in a future
> > version (I am working toward that goal).
> > ...
> > Maybe Git itself is not a good example for that. Bigger projects face
> > dramatically bigger challenges replacing the default branch name because
> > of the short term disruption caused by it. Nevertheless, a growing number
> > of projects have already renamed their default branch, such as Snowpack
> > (https://github.com/snowpackjs/snowpack) and the react-refresh webpack
> > plugin (https://github.com/pmmmwh/react-refresh-webpack-plugin) but also
> > bigger ones such as LLVM (https://github.com/llvm/llvm-project).
>
> Yes, thanks for giving Patricia and likeminded souls more usable
> ammunition than just us ;-)
Daniel Gruesso· Mar 9, 2021, 14:54 UTC · re: Junio C Hamano · lore

Re: RES: Can git change?

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Any repository created on GitHub will have that branch name by default.
> Likewise on Azure DevOps. I fully expect the other hosters to follow at
> some stage, and also for `git init` to change the default in a future
> version (I am working toward that goal).

GitLab product person here, we are indeed planning to change this in our next major release 14.0, shipping on 2021-05-22.

What is the tentative timeline for `git init` to change in default to `main` in the Git project? It would go a long way for the git community.

Thanks,

Daniel Gruesso On Tue, Jan 26, 2021 at 5:38 PM Junio C Hamano <gitster@pobox.com> wrote:

Show 44 quoted lines
>
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > And I have to admit that I am somewhat concerned about your students if
> > one of their instructors thinks that their education shouldn't prepare
> > them for more than working locally on their computers. Aren't they at all
> > interested in preparing the students for life after university? If so,
> > they will most certainly be affected by GitHub's decision.
>
> GitHub's decision will most affect projects that haven't started
> yet, simply because they won't have to incur any "transition" cost
> the existing projects may have to consider.  And given enough time,
> old projects die out and there will be more new projects than the
> projects we currently have, hopefully.
>
> Until that happens, they would be affected more by decision by the
> projects they interact with, as it is most convenient if your local
> name matches the name the upstream uses.  And the versions of Git
> way before people started talking about 'master' and 'main' have
> long been prepared for that, and we've been closing possible gaps in
> the recent versions.  "git clone" would notice what name the upstream
> uses and uses the same name locally.
>
> Even when they work locally, they'll start getting 'main' from their
> Git soon, and that would become consistent with the name that their
> "upstream" projects are likely to choose due to this "industry wide"
> push.
>
>
> > Any repository created on GitHub will have that branch name by default.
> > Likewise on Azure DevOps. I fully expect the other hosters to follow at
> > some stage, and also for `git init` to change the default in a future
> > version (I am working toward that goal).
> > ...
> > Maybe Git itself is not a good example for that. Bigger projects face
> > dramatically bigger challenges replacing the default branch name because
> > of the short term disruption caused by it. Nevertheless, a growing number
> > of projects have already renamed their default branch, such as Snowpack
> > (https://github.com/snowpackjs/snowpack) and the react-refresh webpack
> > plugin (https://github.com/pmmmwh/react-refresh-webpack-plugin) but also
> > bigger ones such as LLVM (https://github.com/llvm/llvm-project).
>
> Yes, thanks for giving Patricia and likeminded souls more usable
> ammunition than just us ;-)
Johannes Schindelin· Mar 10, 2021, 21:03 UTC · lore

Re: RES: Can git change?

Hi Daniel,
On Mon, 8 Mar 2021, Daniel Gruesso wrote:
> Johannes, based on the comments found in
> https://lore.kernel.org/git/xmqqa6vf437i.fsf@gitster.c.googlers.com, I was
> under the impression Git 2.31.0 would ship with 'main' as the default.
> Surprised to see that's likely not the case.

That was the intention of that iteration of the patch series, but it was pointed out that we need a much longer time frame to let Git users get used to the idea that the default branch name is subject to change.

Note also that you're linking to Junio's reply, and in the end it matters more what Junio's intention is than what _my_ intention is.

For now, we do have that advice that's given when you run `git init`. This has been shipped as part of v2.30.0, IIRC. That is, if you run `git init` without setting `init.defaultBranch`, Git will tell you this:

    Using 'master' as the name for the initial branch. This default branch name
    is subject to change. To configure the initial branch name to use in all
    of your new repositories, which will suppress this warning, call:
    	git config --global init.defaultBranch <name>
    Names commonly chosen instead of 'master' are 'main', 'trunk' and
    'development'. The just-created branch can be renamed via this command:
    	git branch -m <name>

I guess that something like 6 months of a "deprecation period" (i.e. the time to keep `master` as the default) _might_ be enough, so we could potentially move forward with changing the default around end of May (by my calculation, v2.32.0 should be due around May 24th, that might be a good candidate to target).

Show 5 quoted lines
> > ...also for `git init` to change the default in a future
> > version (I am working toward that goal).
>
> Where can we follow these changes and what version of Git should we expect
> to contain the change?

Unfortunately, I do not have any such link for you. As to what Git version to expect it to be in: I don't know. That's Junio's call, I guess. Oh, and I still need to write all those patches.

Ciao, Johannes

Show 64 quoted lines
>
>
> Thanks for all you do.
>
>
>
> Daniel
>
> On Mon, Jan 25, 2021 at 11:33 AM Johannes Schindelin <
> Johannes.Schindelin@gmx.de> wrote:
>
> > Hi Patricia,
> >
> > On Sat, 23 Jan 2021, Patricia B. C. wrote:
> >
> > > Yes, as Junio said, my intention was to understand a bit about what
> > > you were doing, so thank you for the explanation!
> > >
> > > The idea isn't really to imitate what you are doing, but just to use
> > > it as a benchmark to show that changing the name of the branch might
> > > not seem like an important thing, but it is a global movement that is
> > > being adopted by many renowned developers.
> >
> > FWIW Git for Windows switched all of its repositories to use `main` as
> > default branch name: its git/git fork, the build-extra, MINGW-packages,
> > MSYS2-packages, git-sdk-32, git-sdk-64, git-for-windows.github.io,
> > msys2-runtime, busybox-w32 and WinToast repositories:
> >
> >         https://github.com/git-for-windows/
> >
> > > Quoting one of the comments on the discussion topic I raised:
> > >
> > > "It's only the default name for repositories created inside GitHub.
> > > Since our students only create their repositories locally on their
> > > computers with Git, I don't see how GitHub's decision will affect
> > > them. If Git decides to change over from master to main, and there is
> > > an industry-wide push to adopt this change (which doesn't seem very
> > > likely to me), then I might agree with you"
> >
> > Any repository created on GitHub will have that branch name by default.
> > Likewise on Azure DevOps. I fully expect the other hosters to follow at
> > some stage, and also for `git init` to change the default in a future
> > version (I am working toward that goal).
> >
> > And I have to admit that I am somewhat concerned about your students if
> > one of their instructors thinks that their education shouldn't prepare
> > them for more than working locally on their computers. Aren't they at all
> > interested in preparing the students for life after university? If so,
> > they will most certainly be affected by GitHub's decision.
> >
> > > So, I just wanted to show that guy that this is an industry-wide push :)
> >
> > Maybe Git itself is not a good example for that. Bigger projects face
> > dramatically bigger challenges replacing the default branch name because
> > of the short term disruption caused by it. Nevertheless, a growing number
> > of projects have already renamed their default branch, such as Snowpack
> > (https://github.com/snowpackjs/snowpack) and the react-refresh webpack
> > plugin (https://github.com/pmmmwh/react-refresh-webpack-plugin) but also
> > bigger ones such as LLVM (https://github.com/llvm/llvm-project).
> >
> > Ciao,
> > Johannes
> >
>
Junio C Hamano· Mar 10, 2021, 21:39 UTC · re: Johannes Schindelin · lore

Re: RES: Can git change?

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
> I guess that something like 6 months of a "deprecation period" (i.e. the
> time to keep `master` as the default) _might_ be enough, so we could
> potentially move forward with changing the default around end of May (by
> my calculation, v2.32.0 should be due around May 24th, that might be a
> good candidate to target).

You are apparently more ambitious and risk tolerant than I am. I was expecting it to be more towards the end of the year myself.

And we already made sure that it would be easy to interact with projects by using the same primary branch name as the upstream project uses when cloning; hopefully by the time we change the built-in hardcoded fallback default, it would not have much impact to the real life usability than it is a symbolic act.

← back to recent threads