Git Mailing List Archive on
 help / color / Atom feed
From: Linus Torvalds <>
To: Jeff King <>
Cc: Junio C Hamano <>,
	Johannes Schindelin <>,
	Git List Mailing <>
Subject: Re: Avoiding 'master' nomenclature
Date: Wed, 29 Jul 2020 14:20:07 -0700
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, Jul 29, 2020 at 1:58 PM Jeff King <> wrote:
> Users can set init.defaultBranch in individual repository config files
> to get the right behavior, though probably it should be a separate
> config variable (the reason it is init.defaultBranch and not
> core.defaultBranch is that you may want different defaults for different
> operations).

That would probably be even better, yes.

It's hard to tell what the default branch of any _particular_ repo is, though.

One option that I considered was to just suppress both "master"
(because that's clearly an old default value) _and_ the new
git_default_branch_name() (as the new default value).

But you're right that you can then interact with systems that have
used yet other defaults.

That said, I still claim that my one-liner is better than what
actually got merged.

> So I think a path forward is more like:
>   1. Add a new config option to shorten fmt-merge-msg's output when the
>      destination branch matches it (and this should perhaps not even be
>      a single name, but a set of globs, which supports more workflows).
>      Call it merge.suppressDest or something.

On that note, I have a special


in my tree, because I want to regularly replace the URL I pull from.

In particular, for, I actually pull through the
non-public-facing master machine (because that way I don't encounter
mirroring delays etc, and since I don't _require_ that people sign
their trees, I want to make sure nobody does any spoofing).

So I use the "url.X.insteadOf" git config functionality to do the
replacement of the URL on the incoming side.

But for the merge messages, I want to do the reverse, and don't want
to expose those not-usable-to-others addresses, so I replace that ssh
access with the public-facing "git://" instead.

I use that prepare-commit-msg hook to do that.

I *could* have done that for branch names too, but that is something
that git has done right for the last 15+ years, so I never had to
worry or think about it.

But a generic replacement (or generation) machinery for the whole line
would be lovely. And then perhaps just _default_ that regex to be the
equivalent of

   sed 's/ into master$//'

would work really well not just for the branch name prettification,
but also for things like that "internal vs external hostnames".

>   2. Optionally a repository created with "git init" could copy its
>      init.defaultBranch into merge.suppressDest. And likewise a clone
>      might copy the remote HEAD into that variable. I'm not sure if that
>      is worth doing or not, but it would restore the original behavior
>      for the most part.

Well, the real objection I have to that commit 489947cee5 is that it
breaks existing users workflow.

So some way of suppressing "into master" by default should be part of
the solution regardless.

Making it optional, so that people who *want* to show the default
branch name can do so, and specify what it is, that sounds like a good

But breaking existing users - that I find to be very objectionable.


  reply index

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 19:44 Linus Torvalds
2020-07-29 20:04 ` Junio C Hamano
2020-07-29 20:23   ` Linus Torvalds
2020-07-29 20:38     ` Jonathan Nieder
2020-07-29 20:46       ` Linus Torvalds
2020-07-29 20:56         ` Linus Torvalds
2020-07-30  8:17       ` lego_12239
2020-07-31  0:57         ` Jeff King
2020-07-31  8:19           ` Oleg
2020-07-29 20:40     ` Linus Torvalds
2020-07-29 20:58       ` Jeff King
2020-07-29 21:20         ` Linus Torvalds [this message]
2020-07-30  0:29           ` Jeff King
2020-07-30  0:44             ` Linus Torvalds
2020-07-30  0:52               ` Jeff King
2020-07-30  0:57                 ` Linus Torvalds
2020-07-31  0:44                   ` Jeff King
2020-07-29 21:25         ` Junio C Hamano
2020-07-29 22:50           ` Junio C Hamano
2020-07-30  0:14             ` Jeff King
2020-07-30  0:23               ` Linus Torvalds
2020-07-30 10:11                 ` Michal Suchánek
2020-07-30  0:31               ` Jeff King
2020-07-30  0:36             ` Junio C Hamano
2020-07-30 18:02               ` [PATCH v3 0/2] fmt-merge-msg: selectively suppress "into <branch>" Junio C Hamano
2020-07-30 18:02                 ` [PATCH v3 1/2] Revert "fmt-merge-msg: stop treating `master` specially" Junio C Hamano
2020-07-30 19:10                   ` Eric Sunshine
2020-07-30 19:40                     ` Junio C Hamano
2020-07-30 18:02                 ` [PATCH v3 2/2] fmt-merge-msg: allow merge destination to be omitted again Junio C Hamano
2020-07-31  0:42                 ` [PATCH v3 0/2] fmt-merge-msg: selectively suppress "into <branch>" Jeff King
2020-07-31  2:04                   ` Junio C Hamano
2020-07-31  2:22                     ` Jeff King
2020-07-31 20:03                       ` Taylor Blau
2020-07-31 20:12                         ` Junio C Hamano
2020-07-31 20:17                           ` Taylor Blau
2020-08-01  7:15                         ` Michal Suchánek
2020-08-10 11:53               ` Avoiding 'master' nomenclature Johannes Schindelin
2020-08-10 15:45                 ` Junio C Hamano
2020-08-11  2:39                   ` Johannes Schindelin
2020-08-12  0:30                     ` Junio C Hamano
2020-07-29 20:40     ` Junio C Hamano
2020-07-29 20:51       ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Mailing List Archive on

Archives are clonable:
	git clone --mirror git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ \
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone