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

Re: [PATCH 0/9] Allow overriding the default name of the default branch

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 16, 2020, 09:47 UTC
Message-ID
<875zbrcpgh.fsf@evledraar.gmail.com>
In-Reply-To
<pull.656.git.1591823971.gitgitgadget@gmail.com>
On Wed, Jun 10 2020, Johannes Schindelin via GitGitGadget wrote:
Show 5 quoted lines
> This series DOES NOT change the default automatically, but only provides an
> opt-in mechanism for interested users. It also presents a way forward for
> such a transition, if and when we decide to do so. Specifically, the new
> GIT_TEST_DEFAULT_BRANCH_NAME environment variable could be used to update
> test scripts on an individual basis instead of all-at-once.

I don't have much time for review today, but hopefully these comments are useful. These comments are on the series as a whole[1] mainly to save myself time in chasing down individual patches, and I think it's more useful as one E-Mail, hopefully.

I think this change is going in a good technical direction. I'm just commenting on the "how it would be done" aspect, I'm not going to add another voice to the larger "is this a useful endeavor?" discussion vis-a-vis what the larger goal is.

But I do have purely technical concerns about where this is going.

The part where we just make it easier to do what you could do all along with sed(1) or whatever to rename the branch after "git init" is obviously correct (or close enough). That part's easy enough.

The parts I'm concerned about is the behavior of how we make the branch name persistent, which is new "while we're at it" behavior in git unrelated to the convenience of allowing a configuration of the main branch name without "git init --template" or after the fact sed(1) munging.

Specifically:
 1. The special case in fmt-merge-msg we always had for "master" sucked
    in terms of producing more verbose merge messages for those of us
    who had repos where the main branch wasn't "master", but at least it
    was consistent.
    Now we've created a situation where a user's local config impacts
    what we put in the machine-generated commit messages.
    Now, these messages were never "plumbing", and other users could use
    different git frontends than "core git" etc, but it's a really
    useful property we've tried to maintain that a user's local
    configuration doesn't change what we put in these messages. It's why
    we've left them out of the i18n mechanism.
 2. The whole core.mainBranch thing rubs me the wrong way. So now if we
    rename a branch we munge it, but if you've got an older git version
    or whatever you get different results and the config isn't carried
    forward.
    I'd *really* like to avoid having what's essentially a refstore
    side-value if we can.
 3. Whatever we do with the submodule guess-a-name functionality, I
    think it's the wrong path to make it proceed in lockstep with
    MAIN_BRANCH_FOR_INIT.
    When you decide to change your branch names != when the rest of the
    world does it.
    Also, whatever the suckyness of the current hardcoded "master"
    behavior I think it sucks more than different users on the same
    version can fail or succeed to clone a repository depending on a
    config they set for "what branch names do I want on new repos?".
    This is simlar to #1, in that I'd much rather have behavior that
    consistently sucks than one that interacts with the wider world
    (writing commits, cloning random other repos) that differs because
    of my *local* config preferences.
 4. For fast-export I think we should just drop this entire "master"
    special case instead of making it read the config. That's also in
    line with its documentation. Let's just call it ref0.
    Either that or just hardcode whatever passes for the "main" branch
    name, but anything but making the to-be-shared anonymized output
    continue to leak local config, similar to #1 and #3 above.

In summary, I'd like this series much better if we split off the convenience change for "init" from the improved heuristics/guesses for remote "master". Just my 0.02.

1. git diff --stat -p @{u}...pr-656/dscho/default-branch-name-option-v2
Previous: Johannes SchindelinNext: Jeff King
Message 175 of 180 in “Allow overriding the default name of the default branch”
  1. 0/9 Allow overriding the default name of the default branchJohannes Schindelin via GitGitGadget, Jun 10, 2020
  2. 1/9 init: allow overriding the default branch name for new repositoriesDon Goodman-Wilson via GitGitGadget, Jun 10, 2020
  3. brian m. carlsonJun 10, 2020
  4. Eric SunshineJun 11, 2020
  5. Johannes SchindelinJun 11, 2020
  6. Junio C HamanoJun 11, 2020
  7. Jeff KingJun 16, 2020
  8. Jeff KingJun 16, 2020
  9. Johannes SchindelinJun 18, 2020
  10. Johannes SchindelinJun 23, 2020
  11. Phillip WoodJun 11, 2020
  12. Johannes SchindelinJun 12, 2020
  13. Junio C HamanoJun 12, 2020
  14. Phillip WoodJun 15, 2020
  15. Johannes SchindelinJun 14, 2020
  16. Alban GruinJun 11, 2020
  17. Junio C HamanoJun 11, 2020
  18. brian m. carlsonJun 11, 2020
  19. Johannes SchindelinJun 12, 2020
  20. Alban GruinJun 13, 2020
  21. Johannes SchindelinJun 14, 2020
  22. Jeff KingJun 16, 2020
  23. Johannes SchindelinJun 18, 2020
  24. 3/9 send-pack/transport-helper: respect `core.defaultBranchName`Johannes Schindelin via GitGitGadget, Jun 10, 2020
  25. 2/9 remote: respect `core.defaultBranchName`Johannes Schindelin via GitGitGadget, Jun 10, 2020
  26. Jeff KingJun 16, 2020
  27. Johannes SchindelinJun 18, 2020
  28. Jeff KingJun 18, 2020
  29. Johannes SchindelinJun 23, 2020
  30. 7/9 fmt-merge-msg: learn about the possibly-configured default branch nameJohannes Schindelin via GitGitGadget, Jun 10, 2020
  31. Junio C HamanoJun 10, 2020
  32. 6/9 clone: learn about the possibly-configured default branch nameJohannes Schindelin via GitGitGadget, Jun 10, 2020
  33. Junio C HamanoJun 10, 2020
  34. 8/9 fast-export: respect the possibly-overridden default branch nameJohannes Schindelin via GitGitGadget, Jun 10, 2020
  35. Matt RogersJun 10, 2020
  36. Junio C HamanoJun 10, 2020
  37. brian m. carlsonJun 10, 2020
  38. Matt RogersJun 11, 2020
  39. Junio C HamanoJun 11, 2020
  40. Johannes SchindelinJun 11, 2020
  41. Re* [PATCH 8/9] fast-export: respect the possibly-overridden default branch nameJunio C Hamano, Jun 11, 2020
  42. Junio C HamanoJun 11, 2020
  43. Junio C HamanoJun 11, 2020
  44. Johannes SchindelinJun 12, 2020
  45. Junio C HamanoJun 12, 2020
  46. Johannes SchindelinJun 12, 2020
  47. Junio C HamanoJun 12, 2020
  48. Johannes SchindelinJun 12, 2020
  49. Johannes SchindelinJun 12, 2020
  50. Junio C HamanoJun 12, 2020
  51. Junio C HamanoJun 12, 2020
  52. Johannes SchindelinJun 13, 2020
  53. Junio C HamanoJun 12, 2020
  54. Johannes SixtJun 13, 2020
  55. Junio C HamanoJun 13, 2020
  56. Johannes SchindelinJun 13, 2020
  57. Junio C HamanoJun 13, 2020
  58. Johannes SchindelinJun 14, 2020
  59. Junio C HamanoJun 17, 2020
  60. Johannes SchindelinJun 23, 2020
  61. Junio C HamanoJun 23, 2020
  62. Johannes SchindelinJun 13, 2020
  63. Johannes SchindelinJun 11, 2020
  64. Junio C HamanoJun 11, 2020
  65. Johannes SchindelinJun 12, 2020
  66. 9/9 Document how the default branch name can be overriddenJohannes Schindelin via GitGitGadget, Jun 10, 2020
  67. Junio C HamanoJun 11, 2020
  68. 5/9 submodule: use the (possibly overridden) default branch nameJohannes Schindelin via GitGitGadget, Jun 10, 2020
  69. Denton LiuJun 15, 2020
  70. 4/9 testsvn: respect `core.defaultBranchName`Johannes Schindelin via GitGitGadget, Jun 10, 2020
  71. Junio C HamanoJun 10, 2020
  72. Junio C HamanoJun 11, 2020
  73. Johannes SchindelinJun 11, 2020
  74. Junio C HamanoJun 11, 2020
  75. brian m. carlsonJun 10, 2020
  76. Taylor BlauJun 11, 2020
  77. Johannes SchindelinJun 11, 2020
  78. Pratyush YadavJun 15, 2020
  79. Johannes SchindelinJun 14, 2020
  80. Denton LiuJun 16, 2020
  81. Johannes SchindelinJun 23, 2020
  82. brian m. carlsonJun 15, 2020
  83. 00/12 Allow overriding the default name of the default branchJohannes Schindelin via GitGitGadget, Jun 15, 2020
  84. 01/12 fast-export: do anonymize the primary branch nameJunio C Hamano via GitGitGadget, Jun 15, 2020
  85. Jeff KingJun 16, 2020
  86. Junio C HamanoJun 17, 2020
  87. Jeff KingJun 17, 2020
  88. Elijah NewrenJun 18, 2020
  89. Junio C HamanoJun 18, 2020
  90. Elijah NewrenJun 18, 2020
  91. Jeff KingJun 18, 2020
  92. 02/12 fmt-merge-msg: introduce a way to override the main branch nameJohannes Schindelin via GitGitGadget, Jun 15, 2020
  93. Phillip WoodJun 15, 2020
  94. Johannes SchindelinJun 23, 2020
  95. Junio C HamanoJun 15, 2020
  96. Johannes SchindelinJun 23, 2020
  97. Ævar Arnfjörð BjarmasonJun 16, 2020
  98. Junio C HamanoJun 17, 2020
  99. Jeff KingJun 16, 2020
  100. Junio C HamanoJun 17, 2020
  101. Johannes SchindelinJun 18, 2020
  102. Johannes SixtJun 17, 2020
  103. Junio C HamanoJun 17, 2020
  104. Johannes SchindelinJun 23, 2020
  105. 05/12 fast-export: handle overridden main branch names correctlyJohannes Schindelin via GitGitGadget, Jun 15, 2020
  106. Phillip WoodJun 15, 2020
  107. Jeff KingJun 16, 2020
  108. Phillip WoodJun 16, 2020
  109. Johannes SchindelinJun 18, 2020
  110. Junio C HamanoJun 15, 2020
  111. Johannes SchindelinJun 23, 2020
  112. 04/12 git_main_branch_name(): optionally report the full ref nameJohannes Schindelin via GitGitGadget, Jun 15, 2020
  113. Phillip WoodJun 15, 2020
  114. Johannes SchindelinJun 23, 2020
  115. 03/12 send-pack/transport-helper: respect `core.mainBranch`Johannes Schindelin via GitGitGadget, Jun 15, 2020
  116. 06/12 branch -m: adjust `core.mainBranch` if necessaryJohannes Schindelin via GitGitGadget, Jun 15, 2020
  117. 12/12 testsvn: respect `init.defaultBranch`Johannes Schindelin via GitGitGadget, Jun 15, 2020
  118. Jeff KingJun 16, 2020
  119. Johannes SchindelinJun 23, 2020
  120. 10/12 remote: learn about the possibly-overridden default main branch nameJohannes Schindelin via GitGitGadget, Jun 15, 2020
  121. 11/12 submodule: use the correct default for the main branch nameJohannes Schindelin via GitGitGadget, Jun 15, 2020
  122. Jeff KingJun 16, 2020
  123. Johannes SchindelinJun 23, 2020
  124. Jeff KingJun 23, 2020
  125. 09/12 clone: handle overridden main branch namesJohannes Schindelin via GitGitGadget, Jun 15, 2020
  126. Jeff KingJun 16, 2020
  127. Johannes SchindelinJun 23, 2020
  128. 08/12 init: allow overriding the default main branch name via the configDon Goodman-Wilson via GitGitGadget, Jun 15, 2020
  129. 07/12 init: allow specifying the main branch name for the new repositoryJohannes Schindelin via GitGitGadget, Jun 15, 2020
  130. 0/8 Allow overriding the default name of the default branchJohannes Schindelin via GitGitGadget, Jun 23, 2020
  131. 2/8 send-pack/transport-helper: avoid mentioning a particular branchJohannes Schindelin via GitGitGadget, Jun 23, 2020
  132. Junio C HamanoJun 24, 2020
  133. Johannes SchindelinJun 24, 2020
  134. Junio C HamanoJun 24, 2020
  135. Johannes SchindelinJun 25, 2020
  136. 1/8 fmt-merge-msg: stop treating `master` speciallyJohannes Schindelin via GitGitGadget, Jun 23, 2020
  137. Junio C HamanoJun 24, 2020
  138. Johannes SchindelinJun 25, 2020
  139. 8/8 testsvn: respect `init.defaultBranch`Johannes Schindelin via GitGitGadget, Jun 23, 2020
  140. 4/8 init: allow specifying the initial branch name for the new repositoryJohannes Schindelin via GitGitGadget, Jun 23, 2020
  141. Junio C HamanoJun 24, 2020
  142. Johannes SchindelinJun 24, 2020
  143. 7/8 remote: use the configured default branch name when appropriateJohannes Schindelin via GitGitGadget, Jun 23, 2020
  144. Junio C HamanoJun 24, 2020
  145. Johannes SchindelinJun 24, 2020
  146. 3/8 submodule: use a better fall-back for missing remote.<name>.branchJohannes Schindelin via GitGitGadget, Jun 23, 2020
  147. Philippe BlainJun 24, 2020
  148. Johannes SchindelinJun 24, 2020
  149. 6/8 clone: use configured default branch name when appropriateJohannes Schindelin via GitGitGadget, Jun 23, 2020
  150. 5/8 init: allow setting the default for the initial branch name via the configDon Goodman-Wilson via GitGitGadget, Jun 23, 2020
  151. Junio C HamanoJun 24, 2020
  152. Johannes SchindelinJun 24, 2020
  153. Junio C HamanoJun 24, 2020
  154. 0/9 Allow overriding the default name of the default branchJohannes Schindelin via GitGitGadget, Jun 24, 2020
  155. 2/9 send-pack/transport-helper: avoid mentioning a particular branchJohannes Schindelin via GitGitGadget, Jun 24, 2020
  156. 7/9 clone: use configured default branch name when appropriateJohannes Schindelin via GitGitGadget, Jun 24, 2020
  157. 9/9 testsvn: respect `init.defaultBranch`Johannes Schindelin via GitGitGadget, Jun 24, 2020
  158. 8/9 remote: use the configured default branch name when appropriateJohannes Schindelin via GitGitGadget, Jun 24, 2020
  159. 4/9 docs: add missing diamond bracketsJohannes Schindelin via GitGitGadget, Jun 24, 2020
  160. 3/9 submodule: fall back to remote's HEAD for missing remote.<name>.branchJohannes Schindelin via GitGitGadget, Jun 24, 2020
  161. Junio C HamanoJun 24, 2020
  162. 1/9 fmt-merge-msg: stop treating `master` speciallyJohannes Schindelin via GitGitGadget, Jun 24, 2020
  163. Đoàn Trần Công DanhJun 29, 2020
  164. Johannes SchindelinJun 29, 2020
  165. Đoàn Trần Công DanhJun 30, 2020
  166. Johannes SchindelinJul 1, 2020
  167. Junio C HamanoJul 1, 2020
  168. 6/9 init: allow setting the default for the initial branch name via the configDon Goodman-Wilson via GitGitGadget, Jun 24, 2020
  169. 5/9 init: allow specifying the initial branch name for the new repositoryJohannes Schindelin via GitGitGadget, Jun 24, 2020
  170. Junio C HamanoJun 24, 2020
  171. Johannes SchindelinJun 25, 2020
  172. brian m. carlsonJun 29, 2020
  173. Edward ThomsonJul 12, 2020
  174. Johannes SchindelinJul 12, 2020
  175. Ævar Arnfjörð BjarmasonJun 16, 2020
  176. Jeff KingJun 16, 2020
  177. Jeff KingJun 16, 2020
  178. Johannes SchindelinJun 23, 2020
  179. Junio C HamanoJun 17, 2020
  180. Johannes SchindelinJul 14, 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.