git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* Keeping the original init.defaultBranch config value
@ 2020-11-18 16:46 Peter Hadlaw
  2020-11-18 17:35 ` Re* " Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Hadlaw @ 2020-11-18 16:46 UTC (permalink / raw)
  To: git

Hello,

Just wanted to confirm that in order to keep new repositories
initializing with `master` as the default branch the command would be:

```
git config --global init.defaultBranch master
```

Regards,
Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re* Keeping the original init.defaultBranch config value
  2020-11-18 16:46 Keeping the original init.defaultBranch config value Peter Hadlaw
@ 2020-11-18 17:35 ` Junio C Hamano
  2020-11-22 19:00   ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2020-11-18 17:35 UTC (permalink / raw)
  To: Peter Hadlaw, Johannes Schindelin; +Cc: git

Peter Hadlaw <hadlawp@gmail.com> writes:

> Hello,
>
> Just wanted to confirm that in order to keep new repositories
> initializing with `master` as the default branch the command would be:
>
> ```
> git config --global init.defaultBranch master
> ```

Yes.

If you have to ask the above question, that would mean the
documentation we have right now probably is not clear enough.  

It is understandable, given that our documentation does not mention
any future plan to change 'master' to other value, but it may still
be a good idea.

The following patch is on 'seen' with Dscho's "prepare for main but
do not flip the final switch yet" series.  I am not committed to the
phrasing, but just showing it as a discussion starter.

Thanks.

--- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ---
Subject: "init" doc: mention the configurability more clearly

Update the description for the '--initial-branch' option to mention
that the historical default has been `master` and it can be
configured to use any name.  When actual transition happens to
another fixed name, say 'main', the description would further be
updated to mention like:

	... fall back to the default name 'main', but it can be
	customized with the `init.defaultBranch` configuration
	variable.  Note that the default name historically was
	'master'.

in order to help people who wonder why more mature projects or
documentation tend not to say 'main'.

While we are at it, stop referring to "HEAD file", which was a
remnant from 2005 that talks too much about implementation detail.
The most important fact is that the current branch is set to an
unborn branch and not detached HEAD.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/git-init.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git i/Documentation/git-init.txt w/Documentation/git-init.txt
index 59ecda6c17..62c7552a12 100644
--- i/Documentation/git-init.txt
+++ w/Documentation/git-init.txt
@@ -20,8 +20,9 @@ DESCRIPTION
 
 This command creates an empty Git repository - basically a `.git`
 directory with subdirectories for `objects`, `refs/heads`,
-`refs/tags`, and template files.  An initial `HEAD` file that
-references the HEAD of the master branch is also created.
+`refs/tags`, and template files.  An unborn branch (see the
+`--initial-branch` option below for its name) is made to the current
+branch.
 
 If the `$GIT_DIR` environment variable is set then it specifies a path
 to use instead of `./.git` for the base of the repository.
@@ -73,8 +74,10 @@ If this is reinitialization, the repository will be moved to the specified path.
 -b <branch-name>::
 --initial-branch=<branch-name>::
 
-Use the specified name for the initial branch in the newly created repository.
-If not specified, fall back to the default name: `master`.
+Use the specified name for the initial branch in the newly created
+repository.  If not specified, fall back to the default name
+'master', but it can be customized with the `init.defaultBranch`
+configuration variable.
 
 --shared[=(false|true|umask|group|all|world|everybody|0xxx)]::
 
o

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re* Keeping the original init.defaultBranch config value
  2020-11-18 17:35 ` Re* " Junio C Hamano
@ 2020-11-22 19:00   ` Johannes Schindelin
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2020-11-22 19:00 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Peter Hadlaw, git

Hi Junio,

On Wed, 18 Nov 2020, Junio C Hamano wrote:

> --- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ---
> Subject: "init" doc: mention the configurability more clearly
>
> Update the description for the '--initial-branch' option to mention
> that the historical default has been `master` and it can be
> configured to use any name.  When actual transition happens to
> another fixed name, say 'main', the description would further be
> updated to mention like:
>
> 	... fall back to the default name 'main', but it can be
> 	customized with the `init.defaultBranch` configuration
> 	variable.  Note that the default name historically was
> 	'master'.
>
> in order to help people who wonder why more mature projects or
> documentation tend not to say 'main'.
>
> While we are at it, stop referring to "HEAD file", which was a
> remnant from 2005 that talks too much about implementation detail.
> The most important fact is that the current branch is set to an
> unborn branch and not detached HEAD.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---

Just to make sure to mention it: I transmogrified this patch into
https://lore.kernel.org/git/1518387eaa95098707878459bc74bd5ef2179386.1606087406.git.gitgitgadget@gmail.com/

Thanks,
Dscho

>  Documentation/git-init.txt | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git i/Documentation/git-init.txt w/Documentation/git-init.txt
> index 59ecda6c17..62c7552a12 100644
> --- i/Documentation/git-init.txt
> +++ w/Documentation/git-init.txt
> @@ -20,8 +20,9 @@ DESCRIPTION
>
>  This command creates an empty Git repository - basically a `.git`
>  directory with subdirectories for `objects`, `refs/heads`,
> -`refs/tags`, and template files.  An initial `HEAD` file that
> -references the HEAD of the master branch is also created.
> +`refs/tags`, and template files.  An unborn branch (see the
> +`--initial-branch` option below for its name) is made to the current
> +branch.
>
>  If the `$GIT_DIR` environment variable is set then it specifies a path
>  to use instead of `./.git` for the base of the repository.
> @@ -73,8 +74,10 @@ If this is reinitialization, the repository will be moved to the specified path.
>  -b <branch-name>::
>  --initial-branch=<branch-name>::
>
> -Use the specified name for the initial branch in the newly created repository.
> -If not specified, fall back to the default name: `master`.
> +Use the specified name for the initial branch in the newly created
> +repository.  If not specified, fall back to the default name
> +'master', but it can be customized with the `init.defaultBranch`
> +configuration variable.
>
>  --shared[=(false|true|umask|group|all|world|everybody|0xxx)]::
>
> o
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-23  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 16:46 Keeping the original init.defaultBranch config value Peter Hadlaw
2020-11-18 17:35 ` Re* " Junio C Hamano
2020-11-22 19:00   ` Johannes Schindelin

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git