{"thread":{"id":"54774","subject":"[PATCH] t5310: stop expecting the default branch name `master`","startedAt":"2020-12-06T13:17:48Z","lastAt":"2020-12-09T14:55:33Z","messageCount":7,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano","Taylor Blau","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"411561","messageId":"pull.809.git.1607260623935.gitgitgadget@gmail.com","threadId":"54774","inReplyTo":null,"subject":"[PATCH] t5310: stop expecting the default branch name `master`","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-12-06T13:17:03Z","receivedAt":"2020-12-06T13:17:48Z","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\nTo open the door for changing the fall-back value for\n`init.defaultBranch` when it is not set by the user, we started to\nmodify the test suite to work with any such fall-back value (instead of\nexpecting the default branch name to be `master`).\n\nTo that end, we specifically rename the initial branch from whatever it\nwas called to `second` (forcing it, just in case that the hard-coded\nfall-back is `second`, in which case the rename is a no-op that would\nfail unless forced).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    Adjust t5310 to be independent of the default branch name\n    \n    Yet another patch making the test suite stop relying on master being the\n    default branch name.\n    \n    This one goes on top of tb/pack-bitmap, and requires an update of\n    js/default-branch-name-tests-final-stretch (it no longer needs to\n    hard-code GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in t5310).\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-809%2Fdscho%2Ft5310-and-the-default-branch-name-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-809/dscho/t5310-and-the-default-branch-name-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/809\n\n t/t5310-pack-bitmaps.sh | 37 +++++++++++++++++++------------------\n 1 file changed, 19 insertions(+), 18 deletions(-)\n\ndiff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh\nindex a83e7a93fbc..55b2cde378b 100755\n--- a/t/t5310-pack-bitmaps.sh\n+++ b/t/t5310-pack-bitmaps.sh\n@@ -23,12 +23,12 @@ has_any () {\n # To ensure the logic for \"maximal commits\" is exercised, make\n # the repository a bit more complicated.\n #\n-#    other                         master\n+#    other                         second\n #      *                             *\n # (99 commits)                  (99 commits)\n #      *                             *\n #      |\\                           /|\n-#      | * octo-other  octo-master * |\n+#      | * octo-other  octo-second * |\n #      |/|\\_________  ____________/|\\|\n #      | \\          \\/  __________/  |\n #      |  | ________/\\ /             |\n@@ -48,10 +48,10 @@ has_any () {\n #\n # The important part for the maximal commit algorithm is how\n # the bitmasks are extended. Assuming starting bit positions\n-# for master (bit 0) and other (bit 1), the bitmasks at the\n+# for second (bit 0) and other (bit 1), the bitmasks at the\n # end should be:\n #\n-#      master: 1       (maximal, selected)\n+#      second: 1       (maximal, selected)\n #       other: 01      (maximal, selected)\n #      (base): 11 (maximal)\n #\n@@ -64,6 +64,7 @@ has_any () {\n \n test_expect_success 'setup repo with moderate-sized history' '\n \ttest_commit_bulk --id=file 10 &&\n+\tgit branch -M second &&\n \tgit checkout -b other HEAD~5 &&\n \ttest_commit_bulk --id=side 10 &&\n \n@@ -71,13 +72,13 @@ test_expect_success 'setup repo with moderate-sized history' '\n \t# ambiguous merge-bases\n \n \tgit checkout -b merge-left other~2 &&\n-\tgit merge master~2 -m \"merge-left\" &&\n+\tgit merge second~2 -m \"merge-left\" &&\n \n-\tgit checkout -b merge-right master~1 &&\n+\tgit checkout -b merge-right second~1 &&\n \tgit merge other~1 -m \"merge-right\" &&\n \n-\tgit checkout -b octo-master master &&\n-\tgit merge merge-left merge-right -m \"octopus-master\" &&\n+\tgit checkout -b octo-second second &&\n+\tgit merge merge-left merge-right -m \"octopus-second\" &&\n \n \tgit checkout -b octo-other other &&\n \tgit merge merge-left merge-right -m \"octopus-other\" &&\n@@ -85,24 +86,24 @@ test_expect_success 'setup repo with moderate-sized history' '\n \tgit checkout other &&\n \tgit merge octo-other -m \"pull octopus\" &&\n \n-\tgit checkout master &&\n-\tgit merge octo-master -m \"pull octopus\" &&\n+\tgit checkout second &&\n+\tgit merge octo-second -m \"pull octopus\" &&\n \n \t# Remove these branches so they are not selected\n \t# as bitmap tips\n \tgit branch -D merge-left &&\n \tgit branch -D merge-right &&\n \tgit branch -D octo-other &&\n-\tgit branch -D octo-master &&\n+\tgit branch -D octo-second &&\n \n \t# add padding to make these merges less interesting\n \t# and avoid having them selected for bitmaps\n \ttest_commit_bulk --id=file 100 &&\n \tgit checkout other &&\n \ttest_commit_bulk --id=side 100 &&\n-\tgit checkout master &&\n+\tgit checkout second &&\n \n-\tbitmaptip=$(git rev-parse master) &&\n+\tbitmaptip=$(git rev-parse second) &&\n \tblob=$(echo tagged-blob | git hash-object -w --stdin) &&\n \tgit tag tagged-blob $blob &&\n \tgit config repack.writebitmaps true\n@@ -141,8 +142,8 @@ rev_list_tests_head () {\n \t'\n \n \ttest_expect_success \"counting non-linear history ($state, $branch)\" '\n-\t\tgit rev-list --count other...master >expect &&\n-\t\tgit rev-list --use-bitmap-index --count other...master >actual &&\n+\t\tgit rev-list --count other...second >expect &&\n+\t\tgit rev-list --use-bitmap-index --count other...second >actual &&\n \t\ttest_cmp expect actual\n \t'\n \n@@ -179,7 +180,7 @@ rev_list_tests_head () {\n rev_list_tests () {\n \tstate=$1\n \n-\tfor branch in \"master\" \"other\"\n+\tfor branch in \"second\" \"other\"\n \tdo\n \t\trev_list_tests_head\n \tdone\n@@ -215,7 +216,7 @@ test_expect_success 'setup further non-bitmapped commits' '\n rev_list_tests 'partial bitmap'\n \n test_expect_success 'fetch (partial bitmap)' '\n-\tgit --git-dir=clone.git fetch origin master:master &&\n+\tgit --git-dir=clone.git fetch origin second:second &&\n \tgit rev-parse HEAD >expect &&\n \tgit --git-dir=clone.git rev-parse HEAD >actual &&\n \ttest_cmp expect actual\n@@ -317,7 +318,7 @@ test_expect_success 'full repack, reusing previous bitmaps' '\n '\n \n test_expect_success 'fetch (full bitmap)' '\n-\tgit --git-dir=clone.git fetch origin master:master &&\n+\tgit --git-dir=clone.git fetch origin second:second &&\n \tgit rev-parse HEAD >expect &&\n \tgit --git-dir=clone.git rev-parse HEAD >actual &&\n \ttest_cmp expect actual\n\nbase-commit: b2555b4647fd66e043db04796670df89156942b6\n-- \ngitgitgadget\n"},{"id":"411613","messageId":"xmqqim9dbh17.fsf@gitster.c.googlers.com","threadId":"54774","inReplyTo":"pull.809.git.1607260623935.gitgitgadget@gmail.com","subject":"Re: [PATCH] t5310: stop expecting the default branch name `master`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-07T18:35:48Z","receivedAt":"2020-12-07T18:36:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n>     This one goes on top of tb/pack-bitmap, and requires an update of\n>     js/default-branch-name-tests-final-stretch (it no longer needs to\n>     hard-code GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in t5310).\n\nAs the targetted topic is not in 'next' and marked with \"Needs a bit\nof reshuffling?\", I'd appreciate this patch to be also forwarded so\nthat I do not have to worry about it myself.\n\nThe same goes for <pull.809.git.1607260623935.gitgitgadget@gmail.com>\nwhich currently sits at the tip of tb/pack-bitmap.\n\nThanks, both.\n"},{"id":"411614","messageId":"xmqqeek1bgvp.fsf@gitster.c.googlers.com","threadId":"54774","inReplyTo":"xmqqim9dbh17.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] t5310: stop expecting the default branch name `master`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-07T18:39:06Z","receivedAt":"2020-12-07T18:40:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n>>     This one goes on top of tb/pack-bitmap, and requires an update of\n>>     js/default-branch-name-tests-final-stretch (it no longer needs to\n>>     hard-code GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in t5310).\n>\n> As the targetted topic is not in 'next' and marked with \"Needs a bit\n> of reshuffling?\", I'd appreciate this patch to be also forwarded so\n> that I do not have to worry about it myself.\n>\n> The same goes for <pull.809.git.1607260623935.gitgitgadget@gmail.com>\n> which currently sits at the tip of tb/pack-bitmap.\n\nOops--wrong branch info.  I meant the patch in\n<pull.811.v2.git.1607354380671.gitgitgadget@gmail.com> that is\ntargetted for the \"git diff\" stuff.\n\n>\n> Thanks, both.\n\n"},{"id":"411734","messageId":"X8/bYzjP569wEL5x@nand.local","threadId":"54774","inReplyTo":"xmqqim9dbh17.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] t5310: stop expecting the default branch name `master`","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2020-12-08T20:00:35Z","receivedAt":"2020-12-08T20:33:54Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Dec 07, 2020 at 10:35:48AM -0800, Junio C Hamano wrote:\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n> >     This one goes on top of tb/pack-bitmap, and requires an update of\n> >     js/default-branch-name-tests-final-stretch (it no longer needs to\n> >     hard-code GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in t5310).\n>\n> As the targetted topic is not in 'next' and marked with \"Needs a bit\n> of reshuffling?\", I'd appreciate this patch to be also forwarded so\n> that I do not have to worry about it myself.\n\nAh, sorry that I missed this before sending out v3. I was hoping that\nthe fixup would be limited to one patch, but this needs to be either\nspread across multiple patches, or applied at the end.\n\nSince I already sent v3, how do you want to handle this?\n\nThanks,\nTaylor\n"},{"id":"411748","messageId":"xmqq360g6lxc.fsf@gitster.c.googlers.com","threadId":"54774","inReplyTo":"X8/bYzjP569wEL5x@nand.local","subject":"Re: [PATCH] t5310: stop expecting the default branch name `master`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-08T21:13:35Z","receivedAt":"2020-12-08T21:14:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Taylor Blau <me@ttaylorr.com> writes:\n\n> On Mon, Dec 07, 2020 at 10:35:48AM -0800, Junio C Hamano wrote:\n>> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n>> writes:\n>>\n>> >     This one goes on top of tb/pack-bitmap, and requires an update of\n>> >     js/default-branch-name-tests-final-stretch (it no longer needs to\n>> >     hard-code GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in t5310).\n>>\n>> As the targetted topic is not in 'next' and marked with \"Needs a bit\n>> of reshuffling?\", I'd appreciate this patch to be also forwarded so\n>> that I do not have to worry about it myself.\n>\n> Ah, sorry that I missed this before sending out v3. I was hoping that\n> the fixup would be limited to one patch, but this needs to be either\n> spread across multiple patches, or applied at the end.\n>\n> Since I already sent v3, how do you want to handle this?\n\nAs I have many other topics on the table to attend to, I can skip v3\nand take v4 if it is not too much trouble to fix the issue at the\nsource.  Thanks.\n"},{"id":"411750","messageId":"X8/x5LaeZgbvXT0l@nand.local","threadId":"54774","inReplyTo":"xmqq360g6lxc.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] t5310: stop expecting the default branch name `master`","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2020-12-08T21:36:36Z","receivedAt":"2020-12-08T21:37:29Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Dec 08, 2020 at 01:13:35PM -0800, Junio C Hamano wrote:\n> Taylor Blau <me@ttaylorr.com> writes:\n>\n> > On Mon, Dec 07, 2020 at 10:35:48AM -0800, Junio C Hamano wrote:\n> >> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> >> writes:\n> >>\n> >> >     This one goes on top of tb/pack-bitmap, and requires an update of\n> >> >     js/default-branch-name-tests-final-stretch (it no longer needs to\n> >> >     hard-code GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in t5310).\n> >>\n> >> As the targetted topic is not in 'next' and marked with \"Needs a bit\n> >> of reshuffling?\", I'd appreciate this patch to be also forwarded so\n> >> that I do not have to worry about it myself.\n> >\n> > Ah, sorry that I missed this before sending out v3. I was hoping that\n> > the fixup would be limited to one patch, but this needs to be either\n> > spread across multiple patches, or applied at the end.\n> >\n> > Since I already sent v3, how do you want to handle this?\n>\n> As I have many other topics on the table to attend to, I can skip v3\n> and take v4 if it is not too much trouble to fix the issue at the\n> source.  Thanks.\n\nNo problem at all. Your instructions were spot on (4/24 and 15/24 needed\nadjusting, as well as the later patches which could no longer be\napplied after modifying those two).\n\nChecking my work against upstream, I can see that the only diff lines\nwhich mention \"master\" are removals:\n\n$ git diff @{u}.. | grep master\n-\tgit checkout master &&\n-\tbitmaptip=$(git rev-parse master) &&\n-\t\tgit rev-list --count other...master >expect &&\n-\t\tgit rev-list --use-bitmap-index --count other...master >actual &&\n-\tgit --git-dir=clone.git fetch origin master:master &&\n-\tgit --git-dir=clone.git fetch origin master:master &&\n\nand spot checking the inter-diff between what I have and what Johannes\nposted I can see that they are the same. I've added some Helped-by lines\nin the relevant patches to indicate where the suggestions came from.\n\nv4 coming shortly...\n\nThanks,\nTaylor\n"},{"id":"411871","messageId":"nycvar.QRO.7.76.6.2012091553210.25979@tvgsbejvaqbjf.bet","threadId":"54774","inReplyTo":"X8/x5LaeZgbvXT0l@nand.local","subject":"Re: [PATCH] t5310: stop expecting the default branch name `master`","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-12-09T14:53:40Z","receivedAt":"2020-12-09T14:55:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Taylor,\n\nOn Tue, 8 Dec 2020, Taylor Blau wrote:\n\n> On Tue, Dec 08, 2020 at 01:13:35PM -0800, Junio C Hamano wrote:\n> > Taylor Blau <me@ttaylorr.com> writes:\n> >\n> > > On Mon, Dec 07, 2020 at 10:35:48AM -0800, Junio C Hamano wrote:\n> > >> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> > >> writes:\n> > >>\n> > >> >     This one goes on top of tb/pack-bitmap, and requires an update of\n> > >> >     js/default-branch-name-tests-final-stretch (it no longer needs to\n> > >> >     hard-code GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in t5310).\n> > >>\n> > >> As the targetted topic is not in 'next' and marked with \"Needs a bit\n> > >> of reshuffling?\", I'd appreciate this patch to be also forwarded so\n> > >> that I do not have to worry about it myself.\n> > >\n> > > Ah, sorry that I missed this before sending out v3. I was hoping that\n> > > the fixup would be limited to one patch, but this needs to be either\n> > > spread across multiple patches, or applied at the end.\n> > >\n> > > Since I already sent v3, how do you want to handle this?\n> >\n> > As I have many other topics on the table to attend to, I can skip v3\n> > and take v4 if it is not too much trouble to fix the issue at the\n> > source.  Thanks.\n>\n> No problem at all. Your instructions were spot on (4/24 and 15/24 needed\n> adjusting, as well as the later patches which could no longer be\n> applied after modifying those two).\n>\n> Checking my work against upstream, I can see that the only diff lines\n> which mention \"master\" are removals:\n>\n> $ git diff @{u}.. | grep master\n> -\tgit checkout master &&\n> -\tbitmaptip=$(git rev-parse master) &&\n> -\t\tgit rev-list --count other...master >expect &&\n> -\t\tgit rev-list --use-bitmap-index --count other...master >actual &&\n> -\tgit --git-dir=clone.git fetch origin master:master &&\n> -\tgit --git-dir=clone.git fetch origin master:master &&\n>\n> and spot checking the inter-diff between what I have and what Johannes\n> posted I can see that they are the same. I've added some Helped-by lines\n> in the relevant patches to indicate where the suggestions came from.\n>\n> v4 coming shortly...\n\nThank you so much for picking this up!\n\nCiao,\nDscho\n"}]}