Thread (1 message) 1 message, 1 author, 2021-03-10

Re: RES: Can git change?

From: Johannes Schindelin <hidden>
Date: 2021-03-10 21:04:29

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 (local), 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).
quoted
...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

Thanks for all you do.



Daniel

On Mon, Jan 25, 2021 at 11:33 AM Johannes Schindelin <
Johannes.Schindelin@gmx.de> wrote:
quoted
Hi Patricia,

On Sat, 23 Jan 2021, Patricia B. C. wrote:
quoted
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/
quoted
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.
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help