Re: [PATCH 3/3] init: provide useful advice about init.defaultBranch

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

 



Hi Junio,

On Sun, 22 Nov 2020, Junio C Hamano wrote:

> Junio C Hamano <gitster@xxxxxxxxx> writes:
>
> >> +static const char default_branch_name_advice[] = N_(
> >> +"Using '%s' as the name for the initial branch. This name is subject\n"
> >> +"to change. To configure the name to use as the initial branch name in\n"
> >> +"new repositories, or to silence this warning, run:\n"
> >
> > s/new repositories/all of your new repositories/ as that is the
> > whole point of using --global option below.
> >
> >> +"\n"
> >> +"\tgit config --global init.defaultBranch <name>\n"
> >> +);
> >> +
>
> The above may give a valuable lesson to those who want to use one
> branch name across new repositories, but it does not tell those who
> wanted 'trunk' (to match the project, perhaps github.com/cli/cli,
> with which they intend to interact) how to recover from having
> already created the 'master' branch.  We may want to add some text
> to suggest "branch -M" after giving the advice for the permanent
> option.

Good point.

> Also, it is unclear to those who do not have a good <name> in mind
> (or, those who do not care to choose a <name> for themselves), what
> <name> they should give to take the "or to silence this warning"
> part of the advice.

Also a good point.

> It probably is a good idea to rephrase and say
> either:
>
>     ... To configure ... in all your new repositories and squelch
>     this message, run:
>
> 	git config --global init.defaultBranch <name>
>
> or
>
>     ... To configure ... in all your new repositories, run:
>
> 	git config --global init.defaultBranch <name>
>
>     Note that this message won't appear after doing so.

I came up with this, which I intend to submit with v2:

static const char default_branch_name_advice[] = N_(
"Using '%s' as the name for the initial branch. This name is subject\n"
"to change. To configure the initial branch name to use in all of your\n"
"new repositories (or to suppress this warning), run:\n"
"\n"
"\tgit config --global init.defaultBranch <name>\n"
"\n"
"Common names are 'main', 'trunk' and 'development'. The initial branch\n"
"can be renamed via this command:\n"
"\n"
"\tgit branch -m <name>\n"
);

Ciao,
Dscho




[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