{"thread":{"id":"54346","subject":"[PATCH 1/2] t1415: avoid using `main` as ref name","startedAt":"2020-10-05T08:56:41Z","lastAt":"2020-10-08T18:15:49Z","messageCount":11,"participants":["Johannes Schindelin via GitGitGadget","Jonathan Nieder","Johannes Schindelin","Derrick Stolee"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"406919","messageId":"d3f7b39a2f11f4b05195f62190f75c84475c237d.1601888196.git.gitgitgadget@gmail.com","threadId":"54346","inReplyTo":"pull.743.git.1601888196.gitgitgadget@gmail.com","subject":"[PATCH 1/2] t1415: avoid using `main` as ref name","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-10-05T08:56:35Z","receivedAt":"2020-10-05T08:56:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIn preparation for a patch series that will change the fall-back for\n`init.defaultBranch` to `main`, let's not use `main` as ref name in this\ntest script.\n\nSince we already use the name \"second\" for a secondary worktree that is\ncreated in this test, let's use the name \"first\" for those refs instead.\n\nWhile at it, adjust the test titles where \"repo\" was used by mistake\ninstead of the term \"worktree\".\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t1415-worktree-refs.sh | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh\nindex bb2c7572a3..7ab91241ab 100755\n--- a/t/t1415-worktree-refs.sh\n+++ b/t/t1415-worktree-refs.sh\n@@ -76,24 +76,24 @@ test_expect_success 'reflog of worktrees/xx/HEAD' '\n \ttest_cmp expected actual.wt2\n '\n \n-test_expect_success 'for-each-ref from main repo' '\n+test_expect_success 'for-each-ref from main worktree' '\n \tmkdir fer1 &&\n \tgit -C fer1 init repo &&\n \ttest_commit -C fer1/repo initial &&\n \tgit -C fer1/repo worktree add ../second &&\n-\tgit -C fer1/repo update-ref refs/bisect/main HEAD &&\n-\tgit -C fer1/repo update-ref refs/rewritten/main HEAD &&\n-\tgit -C fer1/repo update-ref refs/worktree/main HEAD &&\n-\tgit -C fer1/repo for-each-ref --format=\"%(refname)\" | grep main >actual &&\n+\tgit -C fer1/repo update-ref refs/bisect/first HEAD &&\n+\tgit -C fer1/repo update-ref refs/rewritten/first HEAD &&\n+\tgit -C fer1/repo update-ref refs/worktree/first HEAD &&\n+\tgit -C fer1/repo for-each-ref --format=\"%(refname)\" | grep first >actual &&\n \tcat >expected <<-\\EOF &&\n-\trefs/bisect/main\n-\trefs/rewritten/main\n-\trefs/worktree/main\n+\trefs/bisect/first\n+\trefs/rewritten/first\n+\trefs/worktree/first\n \tEOF\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'for-each-ref from linked repo' '\n+test_expect_success 'for-each-ref from linked worktree' '\n \tmkdir fer2 &&\n \tgit -C fer2 init repo &&\n \ttest_commit -C fer2/repo initial &&\n-- \ngitgitgadget\n\n"},{"id":"406920","messageId":"pull.743.git.1601888196.gitgitgadget@gmail.com","threadId":"54346","inReplyTo":null,"subject":"[PATCH 0/2] Avoid main as branch name in the test suite","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-10-05T08:56:34Z","receivedAt":"2020-10-05T08:56:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"In preparation for changing the default branch name to main, let's stop\nusing it as non-default branch name in the test suite.\n\nThis is the last preparatory step before the patch series that intends to\nchange the default branch name to main. See \nhttps://github.com/gitgitgadget/git/pull/655 for the entire game plan.\n\nJohannes Schindelin (2):\n  t1415: avoid using `main` as ref name\n  tests: avoid using the branch name `main`\n\n t/t1415-worktree-refs.sh     | 18 +++++++++---------\n t/t6012-rev-list-simplify.sh |  8 ++++----\n t/t6400-merge-df.sh          |  8 ++++----\n t/t6409-merge-subtree.sh     | 12 ++++++------\n t/t6430-merge-recursive.sh   |  4 ++--\n 5 files changed, 25 insertions(+), 25 deletions(-)\n\n\nbase-commit: 306ee63a703ad67c54ba1209dc11dd9ea500dc1f\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-743%2Fdscho%2Favoid-main-as-branch-name-in-tests-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-743/dscho/avoid-main-as-branch-name-in-tests-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/743\n-- \ngitgitgadget\n"},{"id":"406921","messageId":"6045ceb938836355b7d43bc2088ca2504b05dde4.1601888196.git.gitgitgadget@gmail.com","threadId":"54346","inReplyTo":"pull.743.git.1601888196.gitgitgadget@gmail.com","subject":"[PATCH 2/2] tests: avoid using the branch name `main`","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-10-05T08:56:36Z","receivedAt":"2020-10-05T08:56:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIn the near future, we want to change Git's default branch name to\n`main`. In preparation for that, stop using it as a branch name in the\ntest suite. Replace that branch name by `primary`.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t6012-rev-list-simplify.sh |  8 ++++----\n t/t6400-merge-df.sh          |  8 ++++----\n t/t6409-merge-subtree.sh     | 12 ++++++------\n t/t6430-merge-recursive.sh   |  4 ++--\n 4 files changed, 16 insertions(+), 16 deletions(-)\n\ndiff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh\nindex b6fa43ace0..f1296c29e6 100755\n--- a/t/t6012-rev-list-simplify.sh\n+++ b/t/t6012-rev-list-simplify.sh\n@@ -171,7 +171,7 @@ test_expect_success '--full-diff is not affected by --parents' '\n test_expect_success 'rebuild repo' '\n \trm -rf .git * &&\n \tgit init &&\n-\tgit switch -c main &&\n+\tgit switch -c primary &&\n \n \techo base >file &&\n \tgit add file &&\n@@ -186,7 +186,7 @@ test_expect_success 'rebuild repo' '\n \tgit add file &&\n \ttest_commit B &&\n \n-\tgit switch main &&\n+\tgit switch primary &&\n \ttest_must_fail git merge -m \"M\" B &&\n \techo A >file &&\n \techo B >>file &&\n@@ -207,7 +207,7 @@ test_expect_success 'rebuild repo' '\n \tgit merge -m R -Xtheirs X &&\n \tnote R &&\n \n-\tgit switch main &&\n+\tgit switch primary &&\n \tgit merge -m N R &&\n \tnote N &&\n \n@@ -221,7 +221,7 @@ test_expect_success 'rebuild repo' '\n \tgit add z &&\n \ttest_commit Z &&\n \n-\tgit switch main &&\n+\tgit switch primary &&\n \tgit merge -m O Z &&\n \tnote O &&\n \ndiff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh\nindex 400a4cd139..15f540aae3 100755\n--- a/t/t6400-merge-df.sh\n+++ b/t/t6400-merge-df.sh\n@@ -124,7 +124,7 @@ test_expect_success 'Simple merge in repo with interesting pathnames' '\n \t\tgit add . &&\n \t\tgit commit -m initial &&\n \n-\t\tgit branch main &&\n+\t\tgit branch primary &&\n \t\tgit branch other &&\n \n \t\tgit checkout other &&\n@@ -132,10 +132,10 @@ test_expect_success 'Simple merge in repo with interesting pathnames' '\n \t\tgit add -u &&\n \t\tgit commit -m other &&\n \n-\t\tgit checkout main &&\n-\t\techo main >foo/bar/baz &&\n+\t\tgit checkout primary &&\n+\t\techo primary >foo/bar/baz &&\n \t\tgit add -u &&\n-\t\tgit commit -m main &&\n+\t\tgit commit -m primary &&\n \n \t\tgit merge other &&\n \t\tgit ls-files -s >out &&\ndiff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh\nindex 793f0c8bf3..c236180238 100755\n--- a/t/t6409-merge-subtree.sh\n+++ b/t/t6409-merge-subtree.sh\n@@ -35,11 +35,11 @@ test_expect_success 'setup branch sub' '\n \ttest_commit foo\n '\n \n-test_expect_success 'setup branch main' '\n-\tgit checkout -b main master &&\n+test_expect_success 'setup branch primary' '\n+\tgit checkout -b primary master &&\n \tgit merge -s ours --no-commit --allow-unrelated-histories sub &&\n \tgit read-tree --prefix=dir/ -u sub &&\n-\tgit commit -m \"initial merge of sub into main\" &&\n+\tgit commit -m \"initial merge of sub into primary\" &&\n \ttest_path_is_file dir/foo.t &&\n \ttest_path_is_file hello\n '\n@@ -49,9 +49,9 @@ test_expect_success 'update branch sub' '\n \ttest_commit bar\n '\n \n-test_expect_success 'update branch main' '\n-\tgit checkout main &&\n-\tgit merge -s subtree sub -m \"second merge of sub into main\" &&\n+test_expect_success 'update branch primary' '\n+\tgit checkout primary &&\n+\tgit merge -s subtree sub -m \"second merge of sub into primary\" &&\n \ttest_path_is_file dir/bar.t &&\n \ttest_path_is_file dir/foo.t &&\n \ttest_path_is_file hello\ndiff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh\nindex d48d211a95..900e5c63a7 100755\n--- a/t/t6430-merge-recursive.sh\n+++ b/t/t6430-merge-recursive.sh\n@@ -663,7 +663,7 @@ test_expect_failure 'merge-recursive rename vs. rename/symlink' '\n \n test_expect_success 'merging with triple rename across D/F conflict' '\n \tgit reset --hard HEAD &&\n-\tgit checkout -b main &&\n+\tgit checkout -b primary &&\n \tgit rm -rf . &&\n \n \techo \"just a file\" >sub1 &&\n@@ -682,7 +682,7 @@ test_expect_success 'merging with triple rename across D/F conflict' '\n \ttest_tick &&\n \tgit commit -a -m changesimplefile &&\n \n-\tgit checkout main &&\n+\tgit checkout primary &&\n \tgit rm sub1 &&\n \tgit mv sub2 sub1 &&\n \ttest_tick &&\n-- \ngitgitgadget\n"},{"id":"406924","messageId":"20201005095448.GN1166820@google.com","threadId":"54346","inReplyTo":"d3f7b39a2f11f4b05195f62190f75c84475c237d.1601888196.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/2] t1415: avoid using `main` as ref name","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2020-10-05T09:54:48Z","receivedAt":"2020-10-05T09:54:53Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nJohannes Schindelin wrote:\n\n> In preparation for a patch series that will change the fall-back for\n> `init.defaultBranch` to `main`, let's not use `main` as ref name in this\n> test script.\n\nInteresting.  I assume the issue is this line?\n\n\t-\tgit -C fer1/repo for-each-ref --format=\"%(refname)\" | grep main >actual &&\n\nI.e., it's not actually that naming a worktree \"main\" will break\nanything, but just that the test catches refs/heads/main in the same\nnet when it does grepping?\n\nIf the commit message explains that, then this patch looks good to me.\nWithout such an explanation, it would make me fear that we have some\nunderlying bug in \"git worktree\".\n\nThanks,\nJonathan\n"},{"id":"406925","messageId":"20201005095930.GO1166820@google.com","threadId":"54346","inReplyTo":"6045ceb938836355b7d43bc2088ca2504b05dde4.1601888196.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/2] tests: avoid using the branch name `main`","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2020-10-05T09:59:30Z","receivedAt":"2020-10-05T09:59:35Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Schindelin wrote:\n\n> In the near future, we want to change Git's default branch name to\n> `main`. In preparation for that, stop using it as a branch name in the\n> test suite. Replace that branch name by `primary`.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  t/t6012-rev-list-simplify.sh |  8 ++++----\n>  t/t6400-merge-df.sh          |  8 ++++----\n>  t/t6409-merge-subtree.sh     | 12 ++++++------\n>  t/t6430-merge-recursive.sh   |  4 ++--\n>  4 files changed, 16 insertions(+), 16 deletions(-)\n> \n> diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh\n> index b6fa43ace0..f1296c29e6 100755\n> --- a/t/t6012-rev-list-simplify.sh\n> +++ b/t/t6012-rev-list-simplify.sh\n> @@ -171,7 +171,7 @@ test_expect_success '--full-diff is not affected by --parents' '\n>  test_expect_success 'rebuild repo' '\n>  \trm -rf .git * &&\n>  \tgit init &&\n> -\tgit switch -c main &&\n> +\tgit switch -c primary &&\n\nIs there a secondary corresponding to this primary?\n\nI guess the idea is that this is the trunk that other branches branch\nfrom?  Looking at the history, it seems that this test was added\nrelatively recently and it may have had the upcoming branch name change\nin mind (or in other words if it were an older test it might be expected\nto use \"master\").\n\nThat suggests an alternative that is agnostic to init.defaultBranch:\nwhat if this uses \"git switch -C main\"?\n\nThanks,\nJonathan\n"},{"id":"407125","messageId":"nycvar.QRO.7.76.6.2010080923010.50@tvgsbejvaqbjf.bet","threadId":"54346","inReplyTo":"20201005095448.GN1166820@google.com","subject":"Re: [PATCH 1/2] t1415: avoid using `main` as ref name","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-10-08T07:56:59Z","receivedAt":"2020-10-08T07:57:26Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Mon, 5 Oct 2020, Jonathan Nieder wrote:\n\n>\n> Johannes Schindelin wrote:\n>\n> > In preparation for a patch series that will change the fall-back for\n> > `init.defaultBranch` to `main`, let's not use `main` as ref name in\n> > this test script.\n>\n> Interesting.  I assume the issue is this line?\n>\n> \t-\tgit -C fer1/repo for-each-ref --format=\"%(refname)\" | grep main >actual &&\n>\n> I.e., it's not actually that naming a worktree \"main\" will break\n> anything, but just that the test catches refs/heads/main in the same\n> net when it does grepping?\n\nRight.\n\n> If the commit message explains that, then this patch looks good to me.\n> Without such an explanation, it would make me fear that we have some\n> underlying bug in \"git worktree\".\n\nIndeed. This is my current revision of the commit message:\n\n    t1415: avoid using `main` as ref name\n\n    In preparation for a patch series that will change the fall-back for\n    `init.defaultBranch` to `main`, let's not use `main` as ref name in this\n    test script.\n\n    Otherwise, the `git for-each-ref ... | grep main` which wants to catch\n    those refs would also unexpectedly catch `refs/heads/main`.\n\n    Since the refs in question are worktree-local ones (i.e. each worktree\n    has their own, just like `HEAD`), and since the test case already uses a\n    secondary worktree called \"second\", let's use the name \"first\" for those\n    refs instead.\n\n    While at it, adjust the test titles that talk about a \"repo\" when they\n    meant a \"worktree\" instead.\n\nCiao,\nDscho\n"},{"id":"407126","messageId":"nycvar.QRO.7.76.6.2010080957100.50@tvgsbejvaqbjf.bet","threadId":"54346","inReplyTo":"20201005095930.GO1166820@google.com","subject":"Re: [PATCH 2/2] tests: avoid using the branch name `main`","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-10-08T08:05:41Z","receivedAt":"2020-10-08T08:05:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Mon, 5 Oct 2020, Jonathan Nieder wrote:\n\n> Johannes Schindelin wrote:\n>\n> > In the near future, we want to change Git's default branch name to\n> > `main`. In preparation for that, stop using it as a branch name in the\n> > test suite. Replace that branch name by `primary`.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >  t/t6012-rev-list-simplify.sh |  8 ++++----\n> >  t/t6400-merge-df.sh          |  8 ++++----\n> >  t/t6409-merge-subtree.sh     | 12 ++++++------\n> >  t/t6430-merge-recursive.sh   |  4 ++--\n> >  4 files changed, 16 insertions(+), 16 deletions(-)\n> >\n> > diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh\n> > index b6fa43ace0..f1296c29e6 100755\n> > --- a/t/t6012-rev-list-simplify.sh\n> > +++ b/t/t6012-rev-list-simplify.sh\n> > @@ -171,7 +171,7 @@ test_expect_success '--full-diff is not affected by --parents' '\n> >  test_expect_success 'rebuild repo' '\n> >  \trm -rf .git * &&\n> >  \tgit init &&\n> > -\tgit switch -c main &&\n> > +\tgit switch -c primary &&\n>\n> Is there a secondary corresponding to this primary?\n\nNope, of course not ;-)\n\n> I guess the idea is that this is the trunk that other branches branch\n> from?  Looking at the history, it seems that this test was added\n> relatively recently and it may have had the upcoming branch name change\n> in mind (or in other words if it were an older test it might be expected\n> to use \"master\").\n\nI guess that Stolee (Cc:ed) had something like that in mind.\n\nWhen I look at 8d049e182e2 (revision: --show-pulls adds helpful\nmerges, 2020-04-10), I get the impression that does not _really_ care\nabout the name of the main branch, it just wants to know the name so it\ncan switch back and forth.\n\nIf I had had the presence of mind when reviewing that patch back in April,\nI would probably have advocated for the use of `git switch -`...\n\nIn any case, I would like to keep this consistent with the remainder of\nthe test scripts modified by this patch, and use the relatively neutral\n`topic` here.\n\nCiao,\nDscho\n\n> That suggests an alternative that is agnostic to init.defaultBranch:\n> what if this uses \"git switch -C main\"?\n>\n> Thanks,\n> Jonathan\n>\n"},{"id":"407141","messageId":"pull.743.v2.git.1602152027.gitgitgadget@gmail.com","threadId":"54346","inReplyTo":"pull.743.git.1601888196.gitgitgadget@gmail.com","subject":"[PATCH v2 0/2] Avoid main as branch name in the test suite","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-10-08T10:13:45Z","receivedAt":"2020-10-08T10:13:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"In preparation for changing the default branch name to main, let's stop\nusing it as non-default branch name in the test suite.\n\nThis is the last preparatory step before the patch series that intends to\nchange the default branch name to main. See \nhttps://github.com/gitgitgadget/git/pull/655 for the entire game plan.\n\nChanges since v1:\n\n * The commit message of the t1415 patch elaborates a but more about the\n   rationale for the change.\n * Instead of primary, the second patch renames all of those branches to \n   topic, imitating b6211b89eb3 (tests: avoid variations of the master \n   branch name, 2020-09-26).\n\nJohannes Schindelin (2):\n  t1415: avoid using `main` as ref name\n  tests: avoid using the branch name `main`\n\n t/t1415-worktree-refs.sh     | 18 +++++++++---------\n t/t6012-rev-list-simplify.sh |  8 ++++----\n t/t6400-merge-df.sh          |  8 ++++----\n t/t6409-merge-subtree.sh     | 12 ++++++------\n t/t6430-merge-recursive.sh   |  4 ++--\n 5 files changed, 25 insertions(+), 25 deletions(-)\n\n\nbase-commit: 306ee63a703ad67c54ba1209dc11dd9ea500dc1f\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-743%2Fdscho%2Favoid-main-as-branch-name-in-tests-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-743/dscho/avoid-main-as-branch-name-in-tests-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/743\n\nRange-diff vs v1:\n\n 1:  d3f7b39a2f ! 1:  2c6f41f9ad t1415: avoid using `main` as ref name\n     @@ Commit message\n          `init.defaultBranch` to `main`, let's not use `main` as ref name in this\n          test script.\n      \n     -    Since we already use the name \"second\" for a secondary worktree that is\n     -    created in this test, let's use the name \"first\" for those refs instead.\n     +    Otherwise, the `git for-each-ref ... | grep main` which wants to catch\n     +    those refs would also unexpectedly catch `refs/heads/main`.\n      \n     -    While at it, adjust the test titles where \"repo\" was used by mistake\n     -    instead of the term \"worktree\".\n     +    Since the refs in question are worktree-local ones (i.e. each worktree\n     +    has their own, just like `HEAD`), and since the test case already uses a\n     +    secondary worktree called \"second\", let's use the name \"first\" for those\n     +    refs instead.\n     +\n     +    While at it, adjust the test titles that talk about a \"repo\" when they\n     +    meant a \"worktree\" instead.\n      \n          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n      \n 2:  6045ceb938 ! 2:  b187571778 tests: avoid using the branch name `main`\n     @@ Commit message\n      \n          In the near future, we want to change Git's default branch name to\n          `main`. In preparation for that, stop using it as a branch name in the\n     -    test suite. Replace that branch name by `primary`.\n     +    test suite. Replace that branch name by `topic`, the same name we used\n     +    to rename variations of `master` in b6211b89eb3 (tests: avoid variations\n     +    of the `master` branch name, 2020-09-26).\n      \n          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n      \n     @@ t/t6012-rev-list-simplify.sh: test_expect_success '--full-diff is not affected b\n       \trm -rf .git * &&\n       \tgit init &&\n      -\tgit switch -c main &&\n     -+\tgit switch -c primary &&\n     ++\tgit switch -c topic &&\n       \n       \techo base >file &&\n       \tgit add file &&\n     @@ t/t6012-rev-list-simplify.sh: test_expect_success 'rebuild repo' '\n       \ttest_commit B &&\n       \n      -\tgit switch main &&\n     -+\tgit switch primary &&\n     ++\tgit switch topic &&\n       \ttest_must_fail git merge -m \"M\" B &&\n       \techo A >file &&\n       \techo B >>file &&\n     @@ t/t6012-rev-list-simplify.sh: test_expect_success 'rebuild repo' '\n       \tnote R &&\n       \n      -\tgit switch main &&\n     -+\tgit switch primary &&\n     ++\tgit switch topic &&\n       \tgit merge -m N R &&\n       \tnote N &&\n       \n     @@ t/t6012-rev-list-simplify.sh: test_expect_success 'rebuild repo' '\n       \ttest_commit Z &&\n       \n      -\tgit switch main &&\n     -+\tgit switch primary &&\n     ++\tgit switch topic &&\n       \tgit merge -m O Z &&\n       \tnote O &&\n       \n     @@ t/t6400-merge-df.sh: test_expect_success 'Simple merge in repo with interesting\n       \t\tgit commit -m initial &&\n       \n      -\t\tgit branch main &&\n     -+\t\tgit branch primary &&\n     ++\t\tgit branch topic &&\n       \t\tgit branch other &&\n       \n       \t\tgit checkout other &&\n     @@ t/t6400-merge-df.sh: test_expect_success 'Simple merge in repo with interesting\n       \n      -\t\tgit checkout main &&\n      -\t\techo main >foo/bar/baz &&\n     -+\t\tgit checkout primary &&\n     -+\t\techo primary >foo/bar/baz &&\n     ++\t\tgit checkout topic &&\n     ++\t\techo topic >foo/bar/baz &&\n       \t\tgit add -u &&\n      -\t\tgit commit -m main &&\n     -+\t\tgit commit -m primary &&\n     ++\t\tgit commit -m topic &&\n       \n       \t\tgit merge other &&\n       \t\tgit ls-files -s >out &&\n     @@ t/t6409-merge-subtree.sh: test_expect_success 'setup branch sub' '\n       \n      -test_expect_success 'setup branch main' '\n      -\tgit checkout -b main master &&\n     -+test_expect_success 'setup branch primary' '\n     -+\tgit checkout -b primary master &&\n     ++test_expect_success 'setup topic branch' '\n     ++\tgit checkout -b topic master &&\n       \tgit merge -s ours --no-commit --allow-unrelated-histories sub &&\n       \tgit read-tree --prefix=dir/ -u sub &&\n      -\tgit commit -m \"initial merge of sub into main\" &&\n     -+\tgit commit -m \"initial merge of sub into primary\" &&\n     ++\tgit commit -m \"initial merge of sub into topic\" &&\n       \ttest_path_is_file dir/foo.t &&\n       \ttest_path_is_file hello\n       '\n     @@ t/t6409-merge-subtree.sh: test_expect_success 'update branch sub' '\n      -test_expect_success 'update branch main' '\n      -\tgit checkout main &&\n      -\tgit merge -s subtree sub -m \"second merge of sub into main\" &&\n     -+test_expect_success 'update branch primary' '\n     -+\tgit checkout primary &&\n     -+\tgit merge -s subtree sub -m \"second merge of sub into primary\" &&\n     ++test_expect_success 'update topic branch' '\n     ++\tgit checkout topic &&\n     ++\tgit merge -s subtree sub -m \"second merge of sub into topic\" &&\n       \ttest_path_is_file dir/bar.t &&\n       \ttest_path_is_file dir/foo.t &&\n       \ttest_path_is_file hello\n     @@ t/t6430-merge-recursive.sh: test_expect_failure 'merge-recursive rename vs. rena\n       test_expect_success 'merging with triple rename across D/F conflict' '\n       \tgit reset --hard HEAD &&\n      -\tgit checkout -b main &&\n     -+\tgit checkout -b primary &&\n     ++\tgit checkout -b topic &&\n       \tgit rm -rf . &&\n       \n       \techo \"just a file\" >sub1 &&\n     @@ t/t6430-merge-recursive.sh: test_expect_success 'merging with triple rename acro\n       \tgit commit -a -m changesimplefile &&\n       \n      -\tgit checkout main &&\n     -+\tgit checkout primary &&\n     ++\tgit checkout topic &&\n       \tgit rm sub1 &&\n       \tgit mv sub2 sub1 &&\n       \ttest_tick &&\n\n-- \ngitgitgadget\n"},{"id":"407142","messageId":"2c6f41f9adf361dd700fefaf0fa7819720929c04.1602152027.git.gitgitgadget@gmail.com","threadId":"54346","inReplyTo":"pull.743.v2.git.1602152027.gitgitgadget@gmail.com","subject":"[PATCH v2 1/2] t1415: avoid using `main` as ref name","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-10-08T10:13:46Z","receivedAt":"2020-10-08T10:13:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIn preparation for a patch series that will change the fall-back for\n`init.defaultBranch` to `main`, let's not use `main` as ref name in this\ntest script.\n\nOtherwise, the `git for-each-ref ... | grep main` which wants to catch\nthose refs would also unexpectedly catch `refs/heads/main`.\n\nSince the refs in question are worktree-local ones (i.e. each worktree\nhas their own, just like `HEAD`), and since the test case already uses a\nsecondary worktree called \"second\", let's use the name \"first\" for those\nrefs instead.\n\nWhile at it, adjust the test titles that talk about a \"repo\" when they\nmeant a \"worktree\" instead.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t1415-worktree-refs.sh | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh\nindex bb2c7572a3..7ab91241ab 100755\n--- a/t/t1415-worktree-refs.sh\n+++ b/t/t1415-worktree-refs.sh\n@@ -76,24 +76,24 @@ test_expect_success 'reflog of worktrees/xx/HEAD' '\n \ttest_cmp expected actual.wt2\n '\n \n-test_expect_success 'for-each-ref from main repo' '\n+test_expect_success 'for-each-ref from main worktree' '\n \tmkdir fer1 &&\n \tgit -C fer1 init repo &&\n \ttest_commit -C fer1/repo initial &&\n \tgit -C fer1/repo worktree add ../second &&\n-\tgit -C fer1/repo update-ref refs/bisect/main HEAD &&\n-\tgit -C fer1/repo update-ref refs/rewritten/main HEAD &&\n-\tgit -C fer1/repo update-ref refs/worktree/main HEAD &&\n-\tgit -C fer1/repo for-each-ref --format=\"%(refname)\" | grep main >actual &&\n+\tgit -C fer1/repo update-ref refs/bisect/first HEAD &&\n+\tgit -C fer1/repo update-ref refs/rewritten/first HEAD &&\n+\tgit -C fer1/repo update-ref refs/worktree/first HEAD &&\n+\tgit -C fer1/repo for-each-ref --format=\"%(refname)\" | grep first >actual &&\n \tcat >expected <<-\\EOF &&\n-\trefs/bisect/main\n-\trefs/rewritten/main\n-\trefs/worktree/main\n+\trefs/bisect/first\n+\trefs/rewritten/first\n+\trefs/worktree/first\n \tEOF\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'for-each-ref from linked repo' '\n+test_expect_success 'for-each-ref from linked worktree' '\n \tmkdir fer2 &&\n \tgit -C fer2 init repo &&\n \ttest_commit -C fer2/repo initial &&\n-- \ngitgitgadget\n\n"},{"id":"407143","messageId":"b187571778c2059b853c33637b4e59c5267125f0.1602152027.git.gitgitgadget@gmail.com","threadId":"54346","inReplyTo":"pull.743.v2.git.1602152027.gitgitgadget@gmail.com","subject":"[PATCH v2 2/2] tests: avoid using the branch name `main`","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-10-08T10:13:47Z","receivedAt":"2020-10-08T10:13:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIn the near future, we want to change Git's default branch name to\n`main`. In preparation for that, stop using it as a branch name in the\ntest suite. Replace that branch name by `topic`, the same name we used\nto rename variations of `master` in b6211b89eb3 (tests: avoid variations\nof the `master` branch name, 2020-09-26).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t6012-rev-list-simplify.sh |  8 ++++----\n t/t6400-merge-df.sh          |  8 ++++----\n t/t6409-merge-subtree.sh     | 12 ++++++------\n t/t6430-merge-recursive.sh   |  4 ++--\n 4 files changed, 16 insertions(+), 16 deletions(-)\n\ndiff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh\nindex b6fa43ace0..7fc10f8593 100755\n--- a/t/t6012-rev-list-simplify.sh\n+++ b/t/t6012-rev-list-simplify.sh\n@@ -171,7 +171,7 @@ test_expect_success '--full-diff is not affected by --parents' '\n test_expect_success 'rebuild repo' '\n \trm -rf .git * &&\n \tgit init &&\n-\tgit switch -c main &&\n+\tgit switch -c topic &&\n \n \techo base >file &&\n \tgit add file &&\n@@ -186,7 +186,7 @@ test_expect_success 'rebuild repo' '\n \tgit add file &&\n \ttest_commit B &&\n \n-\tgit switch main &&\n+\tgit switch topic &&\n \ttest_must_fail git merge -m \"M\" B &&\n \techo A >file &&\n \techo B >>file &&\n@@ -207,7 +207,7 @@ test_expect_success 'rebuild repo' '\n \tgit merge -m R -Xtheirs X &&\n \tnote R &&\n \n-\tgit switch main &&\n+\tgit switch topic &&\n \tgit merge -m N R &&\n \tnote N &&\n \n@@ -221,7 +221,7 @@ test_expect_success 'rebuild repo' '\n \tgit add z &&\n \ttest_commit Z &&\n \n-\tgit switch main &&\n+\tgit switch topic &&\n \tgit merge -m O Z &&\n \tnote O &&\n \ndiff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh\nindex 400a4cd139..f1b84617af 100755\n--- a/t/t6400-merge-df.sh\n+++ b/t/t6400-merge-df.sh\n@@ -124,7 +124,7 @@ test_expect_success 'Simple merge in repo with interesting pathnames' '\n \t\tgit add . &&\n \t\tgit commit -m initial &&\n \n-\t\tgit branch main &&\n+\t\tgit branch topic &&\n \t\tgit branch other &&\n \n \t\tgit checkout other &&\n@@ -132,10 +132,10 @@ test_expect_success 'Simple merge in repo with interesting pathnames' '\n \t\tgit add -u &&\n \t\tgit commit -m other &&\n \n-\t\tgit checkout main &&\n-\t\techo main >foo/bar/baz &&\n+\t\tgit checkout topic &&\n+\t\techo topic >foo/bar/baz &&\n \t\tgit add -u &&\n-\t\tgit commit -m main &&\n+\t\tgit commit -m topic &&\n \n \t\tgit merge other &&\n \t\tgit ls-files -s >out &&\ndiff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh\nindex 793f0c8bf3..8b11e00ded 100755\n--- a/t/t6409-merge-subtree.sh\n+++ b/t/t6409-merge-subtree.sh\n@@ -35,11 +35,11 @@ test_expect_success 'setup branch sub' '\n \ttest_commit foo\n '\n \n-test_expect_success 'setup branch main' '\n-\tgit checkout -b main master &&\n+test_expect_success 'setup topic branch' '\n+\tgit checkout -b topic master &&\n \tgit merge -s ours --no-commit --allow-unrelated-histories sub &&\n \tgit read-tree --prefix=dir/ -u sub &&\n-\tgit commit -m \"initial merge of sub into main\" &&\n+\tgit commit -m \"initial merge of sub into topic\" &&\n \ttest_path_is_file dir/foo.t &&\n \ttest_path_is_file hello\n '\n@@ -49,9 +49,9 @@ test_expect_success 'update branch sub' '\n \ttest_commit bar\n '\n \n-test_expect_success 'update branch main' '\n-\tgit checkout main &&\n-\tgit merge -s subtree sub -m \"second merge of sub into main\" &&\n+test_expect_success 'update topic branch' '\n+\tgit checkout topic &&\n+\tgit merge -s subtree sub -m \"second merge of sub into topic\" &&\n \ttest_path_is_file dir/bar.t &&\n \ttest_path_is_file dir/foo.t &&\n \ttest_path_is_file hello\ndiff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh\nindex d48d211a95..a328260d42 100755\n--- a/t/t6430-merge-recursive.sh\n+++ b/t/t6430-merge-recursive.sh\n@@ -663,7 +663,7 @@ test_expect_failure 'merge-recursive rename vs. rename/symlink' '\n \n test_expect_success 'merging with triple rename across D/F conflict' '\n \tgit reset --hard HEAD &&\n-\tgit checkout -b main &&\n+\tgit checkout -b topic &&\n \tgit rm -rf . &&\n \n \techo \"just a file\" >sub1 &&\n@@ -682,7 +682,7 @@ test_expect_success 'merging with triple rename across D/F conflict' '\n \ttest_tick &&\n \tgit commit -a -m changesimplefile &&\n \n-\tgit checkout main &&\n+\tgit checkout topic &&\n \tgit rm sub1 &&\n \tgit mv sub2 sub1 &&\n \ttest_tick &&\n-- \ngitgitgadget\n"},{"id":"407174","messageId":"4d093b96-cdb3-e71a-c669-ee54fbd58ab7@gmail.com","threadId":"54346","inReplyTo":"nycvar.QRO.7.76.6.2010080957100.50@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 2/2] tests: avoid using the branch name `main`","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2020-10-08T18:15:41Z","receivedAt":"2020-10-08T18:15:49Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 10/8/2020 4:05 AM, Johannes Schindelin wrote:\n> On Mon, 5 Oct 2020, Jonathan Nieder wrote:\n>> Johannes Schindelin wrote:\n>>> -\tgit switch -c main &&\n>>> +\tgit switch -c primary &&\n>>\n>> Is there a secondary corresponding to this primary?\n> \n> Nope, of course not ;-)\n> \n>> I guess the idea is that this is the trunk that other branches branch\n>> from?  Looking at the history, it seems that this test was added\n>> relatively recently and it may have had the upcoming branch name change\n>> in mind (or in other words if it were an older test it might be expected\n>> to use \"master\").\n> \n> I guess that Stolee (Cc:ed) had something like that in mind.\n> \n> When I look at 8d049e182e2 (revision: --show-pulls adds helpful\n> merges, 2020-04-10), I get the impression that does not _really_ care\n> about the name of the main branch, it just wants to know the name so it\n> can switch back and forth.\n\nThe branch name here is not important, so please replace it\nwith whatever works best for you.\n\nWhat _is_ important is keeping the commit messages in agreement with\nthe commented ASCII-art DAG above this test. It does not mention the\nbranch names, so this change will not cause an inconsistent comment.\n\nThanks,\n-Stolee\n"}]}