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

[PATCH v3 0/4] breaking changes: switch default initial branch name to "main"

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Sep 10, 2025, 15:28 UTC
Message-ID
<cover.1757518141.git.phillip.wood@dunelm.org.uk>
In-Reply-To
<cover.1756308283.git.phillip.wood@dunelm.org.uk>
From: Phillip Wood <phillip.wood@dunelm.org.uk>

This series switches the default branch name from "master" to "main" when WITH_BREAKING_CHANGES is enabled. We have been warning that the default name will change since 675704c74dd (init: provide useful advice about init.defaultBranch, 2020-12-11) and the major git forges have all switched their default branch name to "main", so I think it makes sense to change the default branch name in git to match the wider ecosystem.

The first patch switches the default initial branch name to "main" and the other three patches remove the last remaining instances of GIT_TEST_DEFAULT_BRANCH_NAME=master from the test suite. Patch 2 is quite large but is mechanically generated so it should be possible to review it by checking that the changes can be reproduced. As this series changes the default branch name it focuses on updating tests that rely on the default branch name being "master", there are still a number of tests that create a branch called "master".

Changes since V2: Patch 1: reworded documentation Patch 3: fixed typo in commit message Patch 4: added helper function to initialise repository

I'm still on the fence about the suggestion to add some advice on how to rename the branch after it is created in order to help users who are following tutorials using "master" rather than "main". One the one hand I can see that would be helpful, on the other it is pretty annoying to everyone else. If it turns out that we want to add it we can always do so at a later date.

V2 Cover letter:

Thanks to everyone who commented on V1, I have dropped the removal of GIT_TEST_DEFAULT_BRANCH_NAME and the test changes related to that but have kept the patches that remove GIT_TEST_DEFAULT_BRANCH_NAME=master. The patches have been re-ordered so that the change to the default initial branch name comes first. That patch now includes a test for the default initial branch name and includes the changes to the commit message and documentation suggested by Patrick and Junio. The commit messages for the other patches have been reworded now that GIT_TEST_DEFAULT_BRANCH_NAME is not being removed but the code changes are the same.

This is an alternative to changing the branch name now as suggested in https://lore.kernel.org/git/pull.1961.git.1756183921623.gitgitgadget@gmail.com

Base-Commit: f814da676ae46aac5be0a98b99373a76dee6cedb
Published-As: https://github.com/phillipwood/git/releases/tag/pw%2Finitial-branch-is-main%2Fv3
View-Changes-At: https://github.com/phillipwood/git/compare/f814da676...353328c61
Fetch-It-Via: git fetch https://github.com/phillipwood/git pw/initial-branch-is-main/v3
Phillip Wood (4):
  breaking-changes: switch default branch to main
  t4013: switch default branch name to main
  t9902: switch default branch name to main
  t0613: stop setting default initial branch
 Documentation/BreakingChanges.adoc            |   6 +
 Documentation/git-init.adoc                   |  12 +-
 advice.c                                      |   2 +
 advice.h                                      |   2 +
 ci/run-build-and-tests.sh                     |   1 -
 refs.c                                        |  15 +-
 t/t0001-init.sh                               |  18 +-
 t/t0613-reftable-write-options.sh             |  24 +-
 t/t4013-diff-various.sh                       | 228 +++++++++---------
 ...ree_--cc_--patch-with-stat_--summary_main} |   2 +-
 ...iff.diff-tree_--cc_--patch-with-stat_main} |   2 +-
 ...r => diff.diff-tree_--cc_--shortstat_main} |   2 +-
 ...diff.diff-tree_--cc_--stat_--summary_main} |   2 +-
 ...master => diff.diff-tree_--cc_--stat_main} |   2 +-
 ...e_--cc_master => diff.diff-tree_--cc_main} |   2 +-
 ...master => diff.diff-tree_-c_--abbrev_main} |   2 +-
 ...> diff.diff-tree_-c_--stat_--summary_main} |   2 +-
 ...t_master => diff.diff-tree_-c_--stat_main} |   2 +-
 ...-tree_-c_master => diff.diff-tree_-c_main} |   2 +-
 ...-tree_-m_master => diff.diff-tree_-m_main} |   2 +-
 ...-p_-m_master => diff.diff-tree_-p_-m_main} |   2 +-
 t/t4013/diff.diff-tree_-p_main                |   2 +
 t/t4013/diff.diff-tree_-p_master              |   2 -
 t/t4013/diff.diff-tree_main                   |   2 +
 t/t4013/diff.diff-tree_master                 |   2 -
 t/t4013/diff.diff_--dirstat_--cc_main~1_main  |   3 +
 .../diff.diff_--dirstat_--cc_master~1_master  |   3 -
 t/t4013/diff.diff_--dirstat_main~1_main~2     |   3 +
 t/t4013/diff.diff_--dirstat_master~1_master~2 |   3 -
 ...ff.diff_--line-prefix=abc_main_main^_side} |   2 +-
 ...master^_side => diff.diff_main_main^_side} |   2 +-
 ...mat-patch_--attach_--stdout_initial..main} |   2 +-
 ...at-patch_--attach_--stdout_initial..main^} |   2 +-
 ...e_--stdout_--numbered-files_initial..main} |   2 +-
 ...t_--subject-prefix=TESTCASE_initial..main} |   2 +-
 ...mat-patch_--inline_--stdout_initial..main} |   2 +-
 ...at-patch_--inline_--stdout_initial..main^} |   2 +-
 ...t-patch_--inline_--stdout_initial..main^^} |   2 +-
 ...--stdout_--cover-letter_-n_initial..main^} |   2 +-
 ...atch_--stdout_--no-numbered_initial..main} |   2 +-
 ...t-patch_--stdout_--numbered_initial..main} |   2 +-
 ... diff.format-patch_--stdout_initial..main} |   2 +-
 ...diff.format-patch_--stdout_initial..main^} |   2 +-
 ..._-m_-p_master => diff.log_--cc_-m_-p_main} |   2 +-
 t/t4013/diff.log_--decorate=full_--all        |   2 +-
 ..._--decorate=full_--clear-decorations_--all |   2 +-
 ...f.log_--decorate=full_--decorate-all_--all |   2 +-
 t/t4013/diff.log_--decorate_--all             |   2 +-
 ...f.log_--decorate_--clear-decorations_--all |   2 +-
 .../diff.log_--decorate_--decorate-all_--all  |   2 +-
 ... diff.log_--diff-merges=first-parent_main} |   2 +-
 ..._--diff-merges=off_-p_--first-parent_main} |   2 +-
 ..._--first-parent_--diff-merges=off_-p_main} |   2 +-
 ...g_--no-diff-merges_-p_--first-parent_main} |   2 +-
 ..._--patch-with-stat_--summary_main_--_dir_} |   2 +-
 ...master => diff.log_--patch-with-stat_main} |   2 +-
 ...> diff.log_--patch-with-stat_main_--_dir_} |   2 +-
 ...oot_--cc_--patch-with-stat_--summary_main} |   2 +-
 ...g_--root_--patch-with-stat_--summary_main} |   2 +-
 ...=> diff.log_--root_--patch-with-stat_main} |   2 +-
 ...-root_-c_--patch-with-stat_--summary_main} |   2 +-
 ...root_-p_master => diff.log_--root_-p_main} |   2 +-
 ...log_--root_master => diff.log_--root_main} |   2 +-
 ...ter => diff.log_-GF_-p_--pickaxe-all_main} |   2 +-
 ...log_-GF_-p_master => diff.log_-GF_-p_main} |   2 +-
 ...{diff.log_-SF_master => diff.log_-GF_main} |   2 +-
 ...aster => diff.log_-IA_-IB_-I1_-I2_-p_main} |   2 +-
 ...log_-SF_-p_master => diff.log_-SF_-p_main} |   2 +-
 ...{diff.log_-GF_master => diff.log_-SF_main} |   2 +-
 t/t4013/diff.log_-SF_main_--max-count=0       |   2 +
 ...ount=2 => diff.log_-SF_main_--max-count=1} |   2 +-
 t/t4013/diff.log_-SF_main_--max-count=2       |   7 +
 t/t4013/diff.log_-SF_master_--max-count=0     |   2 -
 t/t4013/diff.log_-SF_master_--max-count=1     |   7 -
 ...iff.log_-S_F_master => diff.log_-S_F_main} |   2 +-
 ...cc_-m_-p_master => diff.log_-c_-m_-p_main} |   2 +-
 ...-m_--raw_master => diff.log_-m_--raw_main} |   2 +-
 ..._--stat_master => diff.log_-m_--stat_main} |   2 +-
 ...ter => diff.log_-m_-p_--first-parent_main} |   2 +-
 ...f.log_-m_-p_master => diff.log_-m_-p_main} |   2 +-
 ...ff.log_-p_--diff-merges=first-parent_main} |   2 +-
 ...master => diff.log_-p_--first-parent_main} |   2 +-
 .../{diff.log_-p_master => diff.log_-p_main}  |   2 +-
 t/t4013/{diff.log_master => diff.log_main}    |   2 +-
 ...iff.noellipses-diff-tree_-c_--abbrev_main} |   2 +-
 ...> diff.noellipses-whatchanged_--root_main} |   2 +-
 ...r => diff.noellipses-whatchanged_-SF_main} |   2 +-
 ...aster => diff.noellipses-whatchanged_main} |   2 +-
 ...t_master => diff.show_--first-parent_main} |   2 +-
 ...{diff.show_-c_master => diff.show_-c_main} |   2 +-
 ...{diff.show_-m_master => diff.show_-m_main} |   2 +-
 t/t4013/{diff.show_master => diff.show_main}  |   2 +-
 ..._--patch-with-stat_--summary_main_--_dir_} |   2 +-
 ...> diff.whatchanged_--patch-with-stat_main} |   2 +-
 ...hatchanged_--patch-with-stat_main_--_dir_} |   2 +-
 ...oot_--cc_--patch-with-stat_--summary_main} |   2 +-
 ...d_--root_--patch-with-stat_--summary_main} |   2 +-
 ...whatchanged_--root_--patch-with-stat_main} |   2 +-
 ...-root_-c_--patch-with-stat_--summary_main} |   2 +-
 ...master => diff.whatchanged_--root_-p_main} |   2 +-
 ...ot_master => diff.whatchanged_--root_main} |   2 +-
 ...-p_master => diff.whatchanged_-SF_-p_main} |   2 +-
 ...d_-SF_master => diff.whatchanged_-SF_main} |   2 +-
 ...ged_-p_master => diff.whatchanged_-p_main} |   2 +-
 ...atchanged_master => diff.whatchanged_main} |   2 +-
 t/t9902-completion.sh                         |   6 +-
 t/test-lib.sh                                 |  11 +-
 107 files changed, 287 insertions(+), 244 deletions(-)
 rename t/t4013/{diff.diff-tree_--cc_--patch-with-stat_--summary_master => diff.diff-tree_--cc_--patch-with-stat_--summary_main} (86%)
 rename t/t4013/{diff.diff-tree_--cc_--patch-with-stat_master => diff.diff-tree_--cc_--patch-with-stat_main} (89%)
 rename t/t4013/{diff.diff-tree_--cc_--shortstat_master => diff.diff-tree_--cc_--shortstat_main} (65%)
 rename t/t4013/{diff.diff-tree_-c_--stat_--summary_master => diff.diff-tree_--cc_--stat_--summary_main} (71%)
 rename t/t4013/{diff.diff-tree_-c_--stat_master => diff.diff-tree_--cc_--stat_main} (76%)
 rename t/t4013/{diff.diff-tree_--cc_master => diff.diff-tree_--cc_main} (91%)
 rename t/t4013/{diff.diff-tree_-c_--abbrev_master => diff.diff-tree_-c_--abbrev_main} (83%)
 rename t/t4013/{diff.diff-tree_--cc_--stat_--summary_master => diff.diff-tree_-c_--stat_--summary_main} (70%)
 rename t/t4013/{diff.diff-tree_--cc_--stat_master => diff.diff-tree_-c_--stat_main} (75%)
 rename t/t4013/{diff.diff-tree_-c_master => diff.diff-tree_-c_main} (93%)
 rename t/t4013/{diff.diff-tree_-m_master => diff.diff-tree_-m_main} (96%)
 rename t/t4013/{diff.diff-tree_-p_-m_master => diff.diff-tree_-p_-m_main} (97%)
 create mode 100644 t/t4013/diff.diff-tree_-p_main
 delete mode 100644 t/t4013/diff.diff-tree_-p_master
 create mode 100644 t/t4013/diff.diff-tree_main
 delete mode 100644 t/t4013/diff.diff-tree_master
 create mode 100644 t/t4013/diff.diff_--dirstat_--cc_main~1_main
 delete mode 100644 t/t4013/diff.diff_--dirstat_--cc_master~1_master
 create mode 100644 t/t4013/diff.diff_--dirstat_main~1_main~2
 delete mode 100644 t/t4013/diff.diff_--dirstat_master~1_master~2
 rename t/t4013/{diff.diff_--line-prefix=abc_master_master^_side => diff.diff_--line-prefix=abc_main_main^_side} (87%)
 rename t/t4013/{diff.diff_master_master^_side => diff.diff_main_main^_side} (89%)
 rename t/t4013/{diff.format-patch_--attach_--stdout_initial..master => diff.format-patch_--attach_--stdout_initial..main} (98%)
 rename t/t4013/{diff.format-patch_--attach_--stdout_initial..master^ => diff.format-patch_--attach_--stdout_initial..main^} (97%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_--numbered-files_initial..master => diff.format-patch_--inline_--stdout_--numbered-files_initial..main} (99%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master => diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..main} (99%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_initial..master => diff.format-patch_--inline_--stdout_initial..main} (98%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_initial..master^ => diff.format-patch_--inline_--stdout_initial..main^} (97%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_initial..master^^ => diff.format-patch_--inline_--stdout_initial..main^^} (95%)
 rename t/t4013/{diff.format-patch_--stdout_--cover-letter_-n_initial..master^ => diff.format-patch_--stdout_--cover-letter_-n_initial..main^} (96%)
 rename t/t4013/{diff.format-patch_--stdout_--no-numbered_initial..master => diff.format-patch_--stdout_--no-numbered_initial..main} (97%)
 rename t/t4013/{diff.format-patch_--stdout_--numbered_initial..master => diff.format-patch_--stdout_--numbered_initial..main} (97%)
 rename t/t4013/{diff.format-patch_--stdout_initial..master => diff.format-patch_--stdout_initial..main} (97%)
 rename t/t4013/{diff.format-patch_--stdout_initial..master^ => diff.format-patch_--stdout_initial..main^} (96%)
 rename t/t4013/{diff.log_-c_-m_-p_master => diff.log_--cc_-m_-p_main} (99%)
 rename t/t4013/{diff.log_--diff-merges=first-parent_master => diff.log_--diff-merges=first-parent_main} (95%)
 rename t/t4013/{diff.log_--no-diff-merges_-p_--first-parent_master => diff.log_--diff-merges=off_-p_--first-parent_main} (95%)
 rename t/t4013/{diff.log_--first-parent_--diff-merges=off_-p_master => diff.log_--first-parent_--diff-merges=off_-p_main} (95%)
 rename t/t4013/{diff.log_--diff-merges=off_-p_--first-parent_master => diff.log_--no-diff-merges_-p_--first-parent_main} (95%)
 rename t/t4013/{diff.log_--patch-with-stat_--summary_master_--_dir_ => diff.log_--patch-with-stat_--summary_main_--_dir_} (96%)
 rename t/t4013/{diff.log_--patch-with-stat_master => diff.log_--patch-with-stat_main} (98%)
 rename t/t4013/{diff.log_--patch-with-stat_master_--_dir_ => diff.log_--patch-with-stat_main_--_dir_} (96%)
 rename t/t4013/{diff.log_--root_--cc_--patch-with-stat_--summary_master => diff.log_--root_--cc_--patch-with-stat_--summary_main} (98%)
 rename t/t4013/{diff.log_--root_--patch-with-stat_--summary_master => diff.log_--root_--patch-with-stat_--summary_main} (98%)
 rename t/t4013/{diff.log_--root_--patch-with-stat_master => diff.log_--root_--patch-with-stat_main} (98%)
 rename t/t4013/{diff.log_--root_-c_--patch-with-stat_--summary_master => diff.log_--root_-c_--patch-with-stat_--summary_main} (98%)
 rename t/t4013/{diff.log_--root_-p_master => diff.log_--root_-p_main} (98%)
 rename t/t4013/{diff.log_--root_master => diff.log_--root_main} (96%)
 rename t/t4013/{diff.log_-GF_-p_--pickaxe-all_master => diff.log_-GF_-p_--pickaxe-all_main} (90%)
 rename t/t4013/{diff.log_-GF_-p_master => diff.log_-GF_-p_main} (91%)
 rename t/t4013/{diff.log_-SF_master => diff.log_-GF_main} (86%)
 rename t/t4013/{diff.log_-IA_-IB_-I1_-I2_-p_master => diff.log_-IA_-IB_-I1_-I2_-p_main} (97%)
 rename t/t4013/{diff.log_-SF_-p_master => diff.log_-SF_-p_main} (91%)
 rename t/t4013/{diff.log_-GF_master => diff.log_-SF_main} (86%)
 create mode 100644 t/t4013/diff.log_-SF_main_--max-count=0
 rename t/t4013/{diff.log_-SF_master_--max-count=2 => diff.log_-SF_main_--max-count=1} (79%)
 create mode 100644 t/t4013/diff.log_-SF_main_--max-count=2
 delete mode 100644 t/t4013/diff.log_-SF_master_--max-count=0
 delete mode 100644 t/t4013/diff.log_-SF_master_--max-count=1
 rename t/t4013/{diff.log_-S_F_master => diff.log_-S_F_main} (86%)
 rename t/t4013/{diff.log_--cc_-m_-p_master => diff.log_-c_-m_-p_main} (99%)
 rename t/t4013/{diff.log_-m_--raw_master => diff.log_-m_--raw_main} (98%)
 rename t/t4013/{diff.log_-m_--stat_master => diff.log_-m_--stat_main} (98%)
 rename t/t4013/{diff.log_-m_-p_--first-parent_master => diff.log_-m_-p_--first-parent_main} (97%)
 rename t/t4013/{diff.log_-m_-p_master => diff.log_-m_-p_main} (99%)
 rename t/t4013/{diff.log_-p_--diff-merges=first-parent_master => diff.log_-p_--diff-merges=first-parent_main} (97%)
 rename t/t4013/{diff.log_-p_--first-parent_master => diff.log_-p_--first-parent_main} (97%)
 rename t/t4013/{diff.log_-p_master => diff.log_-p_main} (98%)
 rename t/t4013/{diff.log_master => diff.log_main} (97%)
 rename t/t4013/{diff.noellipses-diff-tree_-c_--abbrev_master => diff.noellipses-diff-tree_-c_--abbrev_main} (81%)
 rename t/t4013/{diff.noellipses-whatchanged_--root_master => diff.noellipses-whatchanged_--root_main} (96%)
 rename t/t4013/{diff.noellipses-whatchanged_-SF_master => diff.noellipses-whatchanged_-SF_main} (86%)
 rename t/t4013/{diff.noellipses-whatchanged_master => diff.noellipses-whatchanged_main} (96%)
 rename t/t4013/{diff.show_--first-parent_master => diff.show_--first-parent_main} (92%)
 rename t/t4013/{diff.show_-c_master => diff.show_-c_main} (95%)
 rename t/t4013/{diff.show_-m_master => diff.show_-m_main} (98%)
 rename t/t4013/{diff.show_master => diff.show_main} (96%)
 rename t/t4013/{diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ => diff.whatchanged_--patch-with-stat_--summary_main_--_dir_} (94%)
 rename t/t4013/{diff.whatchanged_--patch-with-stat_master => diff.whatchanged_--patch-with-stat_main} (97%)
 rename t/t4013/{diff.whatchanged_--patch-with-stat_master_--_dir_ => diff.whatchanged_--patch-with-stat_main_--_dir_} (94%)
 rename t/t4013/{diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master => diff.whatchanged_--root_--cc_--patch-with-stat_--summary_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_--patch-with-stat_--summary_master => diff.whatchanged_--root_--patch-with-stat_--summary_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_--patch-with-stat_master => diff.whatchanged_--root_--patch-with-stat_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_-c_--patch-with-stat_--summary_master => diff.whatchanged_--root_-c_--patch-with-stat_--summary_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_-p_master => diff.whatchanged_--root_-p_main} (98%)
 rename t/t4013/{diff.whatchanged_--root_master => diff.whatchanged_--root_main} (97%)
 rename t/t4013/{diff.whatchanged_-SF_-p_master => diff.whatchanged_-SF_-p_main} (89%)
 rename t/t4013/{diff.whatchanged_-SF_master => diff.whatchanged_-SF_main} (86%)
 rename t/t4013/{diff.whatchanged_-p_master => diff.whatchanged_-p_main} (98%)
 rename t/t4013/{diff.whatchanged_master => diff.whatchanged_main} (97%)
Range-diff against v2:
1:  6986375dc37 ! 1:  441bc5f9bcb breaking-changes: switch default branch to main
    @@ Documentation/BreakingChanges.adoc: A prerequisite for this change is that the e
      "reftable" format. Most importantly, alternative implementations of Git like
      JGit, libgit2 and Gitoxide need to support it.
      
    -+* In new repositories the default branch name will be `main`. We have been
    -+  warning that the default name will change since 675704c74dd (init: provide
    -+  useful advice about init.defaultBranch, 2020-12-11).  The new name matches
    -+  the default branch name used by many of the big Git forges.
    ++* In new repositories, the default branch name will be `main`. We have been
    ++  warning that the default name will change since 675704c74dd (init:
    ++  provide useful advice about init.defaultBranch, 2020-12-11).  The new name
    ++  matches the default branch name used in new repositories by many of the
    ++  big Git forges.
     +
      === Removals
      
2:  2a112a1b983 = 2:  f1a778e76c3 t4013: switch default branch name to main
3:  f1bf01e1322 ! 3:  8e32712a158 t9902: switch default branch name to main
    @@ Commit message
         t9902: switch default branch name to main
     
         Remove the penultimate use of "GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=
    -    main" in our test suite. We have slowly been removing these ever since
    -    we started to switch the default branch name used in tests to "main".
    +    master" in our test suite. We have slowly been removing these ever
    +    since we started to switch the default branch name used in tests to
    +    "main".
     
         Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
     
4:  c4d89c3761b ! 4:  353328c6189 t0613: stop setting default initial branch
    @@ Metadata
      ## Commit message ##
         t0613: stop setting default initial branch
     
    -    As the tests are all run in separate repositories, set the branch name
    -    to "master" when creating the repository for the tests where the result
    -    depends on the branch name. This reduceds the number of tests that
    -    depend on the default branch name being "master" and removes the last
    -    instance of a test file using "GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=
    -    master".
    +    As the tests are all run in separate repositories, set the branch
    +    name to "master" when creating the repository for the tests where
    +    the result depends on the branch name. In order to make it easier to
    +    change the branch name in the future a helper function is used. This
    +    reduces the number of tests that depend on the default branch name
    +    being "master" and removes the last instance of a test file using
    +    "GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master".
     
    +    Helped-by: Junio C Hamano <gitster@pobox.com>
         Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
     
      ## t/t0613-reftable-write-options.sh ##
    @@ t/t0613-reftable-write-options.sh: export GIT_TEST_REFTABLE_AUTOCOMPACTION
      
      . ./test-lib.sh
      
    ++# Block sizes depend on the actual refs we write, so, for tests
    ++# that check block size, we force the initial branch name to be "master".
    ++init_repo () {
    ++	git init --initial-branch master repo
    ++}
    ++
      test_expect_success 'default write options' '
      	test_when_finished "rm -rf repo" &&
     -	git init repo &&
    -+	# Block sizes also depend on the actual refs we write, so we force
    -+	# "master" to be the default initial branch name.
    -+	git init --initial-branch master repo &&
    ++	init_repo &&
      	(
      		cd repo &&
      		test_commit initial &&
    @@ t/t0613-reftable-write-options.sh: test_expect_success 'default write options' '
      	test_config_global core.logAllRefUpdates false &&
      	test_when_finished "rm -rf repo" &&
     -	git init repo &&
    -+	git init --initial-branch master repo &&
    ++	init_repo &&
      	(
      		cd repo &&
      		test_commit initial &&
    @@ t/t0613-reftable-write-options.sh: test_expect_success 'disabled reflog writes n
      test_expect_success 'many refs results in multiple blocks' '
      	test_when_finished "rm -rf repo" &&
     -	git init repo &&
    -+	git init --initial-branch master repo &&
    ++	init_repo &&
      	(
      		cd repo &&
      		test_commit initial &&
    @@ t/t0613-reftable-write-options.sh: test_expect_success 'tiny block size leads to
      	test_config_global core.logAllRefUpdates false &&
      	test_when_finished "rm -rf repo" &&
     -	git init repo &&
    -+	git init --initial-branch master repo &&
    ++	init_repo &&
      	(
      		cd repo &&
      		test_commit A &&
    @@ t/t0613-reftable-write-options.sh: test_expect_success 'block size exceeding max
      test_expect_success 'restart interval at every single record' '
      	test_when_finished "rm -rf repo" &&
     -	git init repo &&
    -+	git init --initial-branch master repo &&
    ++	init_repo &&
      	(
      		cd repo &&
      		test_commit initial &&
    @@ t/t0613-reftable-write-options.sh: test_expect_success 'restart interval exceedi
      	test_config_global core.logAllRefUpdates false &&
      	test_when_finished "rm -rf repo" &&
     -	git init repo &&
    -+	git init --initial-branch master repo &&
    ++	init_repo &&
      	(
      		cd repo &&
      		test_commit initial &&
    @@ t/t0613-reftable-write-options.sh: test_expect_success 'object index gets writte
      	test_config_global core.logAllRefUpdates false &&
      	test_when_finished "rm -rf repo" &&
     -	git init repo &&
    -+	git init --initial-branch master repo &&
    ++	init_repo &&
      	(
      		cd repo &&
      		test_commit initial &&
-- 
2.49.0.897.gfad3eb7d210
Previous: Phillip WoodNext: Phillip Wood
Message 41 of 56 in “breaking changes: switch default initial branch name to "main"”
  1. 0/6 breaking changes: switch default initial branch name to "main"Phillip Wood, Aug 27, 2025
  2. 1/6 t0018: switch default branch name to mainPhillip Wood, Aug 27, 2025
  3. Junio C HamanoAug 27, 2025
  4. Phillip WoodAug 28, 2025
  5. Junio C HamanoAug 28, 2025
  6. brian m. carlsonAug 28, 2025
  7. 3/6 t9902: switch default branch name to mainPhillip Wood, Aug 27, 2025
  8. 2/6 t4013: switch default branch name to mainPhillip Wood, Aug 27, 2025
  9. 4/6 t0613: stop setting default initial branchPhillip Wood, Aug 27, 2025
  10. Junio C HamanoAug 27, 2025
  11. 5/6 t1403: remove dependency on GIT_TEST_DEFAULT_INITIAL_BRANCH_NAMEPhillip Wood, Aug 27, 2025
  12. 6/6 breaking-changes: switch default branch to mainPhillip Wood, Aug 27, 2025
  13. Junio C HamanoAug 27, 2025
  14. Patrick SteinhardtSep 2, 2025
  15. Phillip WoodSep 2, 2025
  16. Patrick SteinhardtSep 3, 2025
  17. Phillip WoodSep 3, 2025
  18. Patrick SteinhardtSep 3, 2025
  19. Junio C HamanoSep 3, 2025
  20. Patrick SteinhardtSep 4, 2025
  21. Phillip WoodSep 4, 2025
  22. Patrick SteinhardtSep 5, 2025
  23. Phillip WoodSep 4, 2025
  24. Johannes SchindelinAug 28, 2025
  25. 0/4 breaking changes: switch default initial branch name to "main"Phillip Wood, Sep 4, 2025
  26. 1/4 breaking-changes: switch default branch to mainPhillip Wood, Sep 4, 2025
  27. Junio C HamanoSep 4, 2025
  28. Phillip WoodSep 5, 2025
  29. Junio C HamanoSep 5, 2025
  30. 3/4 t9902: switch default branch name to mainPhillip Wood, Sep 4, 2025
  31. Junio C HamanoSep 4, 2025
  32. Phillip WoodSep 5, 2025
  33. Patrick SteinhardtSep 5, 2025
  34. Phillip WoodSep 9, 2025
  35. 2/4 t4013: switch default branch name to mainPhillip Wood, Sep 4, 2025
  36. 4/4 t0613: stop setting default initial branchPhillip Wood, Sep 4, 2025
  37. Junio C HamanoSep 4, 2025
  38. Phillip WoodSep 5, 2025
  39. Junio C HamanoSep 4, 2025
  40. Phillip WoodSep 4, 2025
  41. 0/4 breaking changes: switch default initial branch name to "main"Phillip Wood, Sep 10, 2025
  42. 1/4 breaking-changes: switch default branch to mainPhillip Wood, Sep 10, 2025
  43. 2/4 t4013: switch default branch name to mainPhillip Wood, Sep 10, 2025
  44. 3/4 t9902: switch default branch name to mainPhillip Wood, Sep 10, 2025
  45. 4/4 t0613: stop setting default initial branchPhillip Wood, Sep 10, 2025
  46. Junio C HamanoSep 10, 2025
  47. Junio C HamanoSep 17, 2025
  48. Kristoffer HaugsbakkSep 17, 2025
  49. Junio C HamanoSep 17, 2025
  50. Phillip WoodSep 17, 2025
  51. Junio C HamanoSep 17, 2025
  52. Junio C HamanoSep 17, 2025
  53. Phillip WoodSep 18, 2025
  54. 5/4 initial branch: give hints after switching the default nameJunio C Hamano, Sep 17, 2025
  55. Phillip WoodSep 18, 2025
  56. Junio C HamanoSep 18, 2025

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.