git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Avoiding 'master' nomenclature

From
Jeff King <peff@peff.net>
Date
Jul 29, 2020, 20:58 UTC
Message-ID
<20200729205846.GA2992025@coredump.intra.peff.net>
In-Reply-To
<CAHk-=wi2dsROeg=mij5C8O=UBVZGEpOUp=Bn-arQ7i+Wscynnw@mail.gmail.com>
On Wed, Jul 29, 2020 at 01:40:17PM -0700, Linus Torvalds wrote:
Show 14 quoted lines
> > So really. Both from a technical _and_ a terminology angle, that
> > commit was just wrong.
> 
> So here's the fix.
> 
> The fix is effectively a revert of the patch (and a follow-up
> test-case patch), and instead just replaces the "master" nomenclature
> with "git_default_branch_name()".
> 
> This patch actually removes more uses of "master" than it adds to git,
> and unlike the patches it replaces, actually removes it from other
> projects commit logs.
> 
> Now whatever default branch name you choose really is immaterial.
I don't think that covers all cases.

If I set init.defaultBranch, then that only sets the default branch name for new repositories I create with "git init". But I may still interact with many repositories that use a different name (either "master", or other names chosen by individual projects).

If you suppressed the output for both "master" and git_default_branch_name(), that would cover more cases, at the expense of occasionally doing the wrong thing when some project uses "master" but doesn't mean for it to be a default branch (but that's presumably rare). It would still do the wrong thing if you prefer "foo" as the default branch name for your projects, but sometimes work on a project that prefers "bar".

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).

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.
  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.
-Peff
Previous: Linus TorvaldsNext: Linus Torvalds
Message 11 of 42 in “Avoiding 'master' nomenclature”
  1. Linus TorvaldsJul 29, 2020
  2. Junio C HamanoJul 29, 2020
  3. Linus TorvaldsJul 29, 2020
  4. Jonathan NiederJul 29, 2020
  5. Linus TorvaldsJul 29, 2020
  6. Linus TorvaldsJul 29, 2020
  7. lego_12239@rambler.ruJul 30, 2020
  8. Jeff KingJul 31, 2020
  9. OlegJul 31, 2020
  10. Linus TorvaldsJul 29, 2020
  11. Jeff KingJul 29, 2020
  12. Linus TorvaldsJul 29, 2020
  13. Jeff KingJul 30, 2020
  14. Linus TorvaldsJul 30, 2020
  15. Jeff KingJul 30, 2020
  16. Linus TorvaldsJul 30, 2020
  17. Jeff KingJul 31, 2020
  18. Junio C HamanoJul 29, 2020
  19. Junio C HamanoJul 29, 2020
  20. Jeff KingJul 30, 2020
  21. Linus TorvaldsJul 30, 2020
  22. Michal SuchánekJul 30, 2020
  23. Jeff KingJul 30, 2020
  24. Junio C HamanoJul 30, 2020
  25. 0/2 fmt-merge-msg: selectively suppress "into <branch>"Junio C Hamano, Jul 30, 2020
  26. 2/2 fmt-merge-msg: allow merge destination to be omitted againJunio C Hamano, Jul 30, 2020
  27. 1/2 Revert "fmt-merge-msg: stop treating `master` specially"Junio C Hamano, Jul 30, 2020
  28. Eric SunshineJul 30, 2020
  29. Junio C HamanoJul 30, 2020
  30. Jeff KingJul 31, 2020
  31. Junio C HamanoJul 31, 2020
  32. Jeff KingJul 31, 2020
  33. Taylor BlauJul 31, 2020
  34. Junio C HamanoJul 31, 2020
  35. Taylor BlauJul 31, 2020
  36. Michal SuchánekAug 1, 2020
  37. Johannes SchindelinAug 10, 2020
  38. Junio C HamanoAug 10, 2020
  39. Johannes SchindelinAug 11, 2020
  40. Junio C HamanoAug 12, 2020
  41. Junio C HamanoJul 29, 2020
  42. Linus TorvaldsJul 29, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.