{"thread":{"id":"54664","subject":"[PATCH 0/3] t2106 vs. the default branch name","startedAt":"2020-11-18T14:49:33Z","lastAt":"2020-11-18T22:26:26Z","messageCount":9,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"410230","messageId":"pull.792.git.1605710947.gitgitgadget@gmail.com","threadId":"54664","inReplyTo":null,"subject":"[PATCH 0/3] t2106 vs. the default branch name","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-11-18T14:49:04Z","receivedAt":"2020-11-18T14:49:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Yet another thing I noticed while working on \nhttps://github.com/gitgitgadget/git/pull/762.\n\nJohannes Schindelin (3):\n  t2106: adjust style to the current conventions\n  t2106: make test independent of the current main branch name\n  t2106: ensure that the checkout fails for the expected reason\n\n t/t2106-update-index-assume-unchanged.sh | 31 +++++++++++++-----------\n 1 file changed, 17 insertions(+), 14 deletions(-)\n\n\nbase-commit: e31aba42fb12bdeb0f850829e008e1e3f43af500\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-792%2Fdscho%2Ft2106-and-default-branch-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-792/dscho/t2106-and-default-branch-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/792\n-- \ngitgitgadget\n"},{"id":"410231","messageId":"d477b02b5a3ca6d2beef5bdea21407a3c555f83e.1605710947.git.gitgitgadget@gmail.com","threadId":"54664","inReplyTo":"pull.792.git.1605710947.gitgitgadget@gmail.com","subject":"[PATCH 2/3] t2106: make test independent of the current main branch name","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-11-18T14:49:06Z","receivedAt":"2020-11-18T14:49:33Z","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\nWe do have this wonderful shortcut `git checkout -` to go back to the\nprevious branch, thanks to the reflog.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t2106-update-index-assume-unchanged.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh\nindex ff0947f388..3396f23363 100755\n--- a/t/t2106-update-index-assume-unchanged.sh\n+++ b/t/t2106-update-index-assume-unchanged.sh\n@@ -20,7 +20,7 @@ test_expect_success 'do not switch branches with dirty file' '\n \tgit checkout other &&\n \techo dirt >file &&\n \tgit update-index --assume-unchanged file &&\n-\ttest_must_fail git checkout master\n+\ttest_must_fail git checkout -\n '\n \n test_done\n-- \ngitgitgadget\n\n"},{"id":"410232","messageId":"7a750f1317143bf4488c21bd11c4e59558a3d7c6.1605710947.git.gitgitgadget@gmail.com","threadId":"54664","inReplyTo":"pull.792.git.1605710947.gitgitgadget@gmail.com","subject":"[PATCH 3/3] t2106: ensure that the checkout fails for the expected reason","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-11-18T14:49:07Z","receivedAt":"2020-11-18T14:49:33Z","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\nDuring the transition of the test suite to a new default branch name, it\nwas noticed that this test case succeeded for the wrong reason when the\ndefault branch name was overridden.\n\nWhile we fixed that in the previous commit, let's make sure that we look\nfor a tell-tale in the error message that the `git checkout` failed for\nthe reason we wanted it to fail.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t2106-update-index-assume-unchanged.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh\nindex 3396f23363..2d450daf5c 100755\n--- a/t/t2106-update-index-assume-unchanged.sh\n+++ b/t/t2106-update-index-assume-unchanged.sh\n@@ -20,7 +20,8 @@ test_expect_success 'do not switch branches with dirty file' '\n \tgit checkout other &&\n \techo dirt >file &&\n \tgit update-index --assume-unchanged file &&\n-\ttest_must_fail git checkout -\n+\ttest_must_fail git checkout - 2>err &&\n+\ttest_i18ngrep overwritten err\n '\n \n test_done\n-- \ngitgitgadget\n"},{"id":"410233","messageId":"74828089e672024fd6e4aa23675939fe5b11eda2.1605710947.git.gitgitgadget@gmail.com","threadId":"54664","inReplyTo":"pull.792.git.1605710947.gitgitgadget@gmail.com","subject":"[PATCH 1/3] t2106: adjust style to the current conventions","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-11-18T14:49:05Z","receivedAt":"2020-11-18T14:49:33Z","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\nWe settled on the style where the test cases' code starts by the opening\nsingle quote being on the `test_expect_*` line, and the closing quote\nbeing in its own line after the code.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t2106-update-index-assume-unchanged.sh | 30 +++++++++++++-----------\n 1 file changed, 16 insertions(+), 14 deletions(-)\n\ndiff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh\nindex 99d858c6b7..ff0947f388 100755\n--- a/t/t2106-update-index-assume-unchanged.sh\n+++ b/t/t2106-update-index-assume-unchanged.sh\n@@ -5,20 +5,22 @@ test_description='git update-index --assume-unchanged test.\n \n . ./test-lib.sh\n \n-test_expect_success 'setup' \\\n-\t': >file &&\n-\t git add file &&\n-\t git commit -m initial &&\n-\t git branch other &&\n-\t echo upstream >file &&\n-\t git add file &&\n-\t git commit -m upstream'\n+test_expect_success 'setup' '\n+\t: >file &&\n+\tgit add file &&\n+\tgit commit -m initial &&\n+\tgit branch other &&\n+\techo upstream >file &&\n+\tgit add file &&\n+\tgit commit -m upstream\n+'\n \n-test_expect_success 'do not switch branches with dirty file' \\\n-\t'git reset --hard &&\n-\t git checkout other &&\n-\t echo dirt >file &&\n-\t git update-index --assume-unchanged file &&\n-\t test_must_fail git checkout master'\n+test_expect_success 'do not switch branches with dirty file' '\n+\tgit reset --hard &&\n+\tgit checkout other &&\n+\techo dirt >file &&\n+\tgit update-index --assume-unchanged file &&\n+\ttest_must_fail git checkout master\n+'\n \n test_done\n-- \ngitgitgadget\n\n"},{"id":"410253","messageId":"xmqqsg961pyo.fsf@gitster.c.googlers.com","threadId":"54664","inReplyTo":"d477b02b5a3ca6d2beef5bdea21407a3c555f83e.1605710947.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/3] t2106: make test independent of the current main branch name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-11-18T18:26:23Z","receivedAt":"2020-11-18T18:26:37Z","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> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> We do have this wonderful shortcut `git checkout -` to go back to the\n> previous branch, thanks to the reflog.\n\n;-)\n\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  t/t2106-update-index-assume-unchanged.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh\n> index ff0947f388..3396f23363 100755\n> --- a/t/t2106-update-index-assume-unchanged.sh\n> +++ b/t/t2106-update-index-assume-unchanged.sh\n> @@ -20,7 +20,7 @@ test_expect_success 'do not switch branches with dirty file' '\n>  \tgit checkout other &&\n>  \techo dirt >file &&\n>  \tgit update-index --assume-unchanged file &&\n> -\ttest_must_fail git checkout master\n> +\ttest_must_fail git checkout -\n>  '\n>  \n>  test_done\n"},{"id":"410272","messageId":"xmqq1rgq1jgf.fsf@gitster.c.googlers.com","threadId":"54664","inReplyTo":"pull.792.git.1605710947.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/3] t2106 vs. the default branch name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-11-18T20:46:56Z","receivedAt":"2020-11-18T20:47:35Z","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> Yet another thing I noticed while working on \n> https://github.com/gitgitgadget/git/pull/762.\n>\n> Johannes Schindelin (3):\n>   t2106: adjust style to the current conventions\n>   t2106: make test independent of the current main branch name\n>   t2106: ensure that the checkout fails for the expected reason\n>\n>  t/t2106-update-index-assume-unchanged.sh | 31 +++++++++++++-----------\n>  1 file changed, 17 insertions(+), 14 deletions(-)\n\nThis seems to partly replicate and partly deprecate what is in that\nfinal stretch 27-or-28 patch series does to the same test script.\nAre we taking this and then removing a patch or two from that larger\nseries?\n"},{"id":"410275","messageId":"nycvar.QRO.7.76.6.2011182152580.56@tvgsbejvaqbjf.bet","threadId":"54664","inReplyTo":"xmqq1rgq1jgf.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 0/3] t2106 vs. the default branch name","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-11-18T20:56:41Z","receivedAt":"2020-11-18T20:57:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 18 Nov 2020, Junio C Hamano wrote:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n> > Yet another thing I noticed while working on\n> > https://github.com/gitgitgadget/git/pull/762.\n> >\n> > Johannes Schindelin (3):\n> >   t2106: adjust style to the current conventions\n> >   t2106: make test independent of the current main branch name\n> >   t2106: ensure that the checkout fails for the expected reason\n> >\n> >  t/t2106-update-index-assume-unchanged.sh | 31 +++++++++++++-----------\n> >  1 file changed, 17 insertions(+), 14 deletions(-)\n>\n> This seems to partly replicate and partly deprecate what is in that\n> final stretch 27-or-28 patch series does to the same test script.\n> Are we taking this and then removing a patch or two from that larger\n> series?\n\nSorry, I meant to explain my current thinking: for v3, I want to\naccommodate your wish (to mark every test script with the hard-coded\ndefault branch name individually, and only those test scripts that\nactually need to hard-code it). It is not only to fulfill your wish, I got\ngenuinely curious what would actually be needed to make that happen.\n\nThe four test scripts for which I sent patch series in the past hours to\nremove the use of the name `master` won't be touched by v3 of this here\npatch series at all (because it won't be necessary anymore).\n\nCiao,\nDscho\n"},{"id":"410278","messageId":"xmqqsg96z602.fsf@gitster.c.googlers.com","threadId":"54664","inReplyTo":"nycvar.QRO.7.76.6.2011182152580.56@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 0/3] t2106 vs. the default branch name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-11-18T21:53:33Z","receivedAt":"2020-11-18T21:53:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n\n> The four test scripts for which I sent patch series in the past hours to\n> remove the use of the name `master` won't be touched by v3 of this here\n> patch series at all (because it won't be necessary anymore).\n\nAh, OK.  I somehow had an impression that the big series was more or\nless done but rethinking the structure and ejecting these changes to\ntests that do not care what name the \"init\" uses by default from the\nseries makes a lot of sense.\n\nThanks.\n"},{"id":"410279","messageId":"nycvar.QRO.7.76.6.2011182324370.56@tvgsbejvaqbjf.bet","threadId":"54664","inReplyTo":"xmqqsg96z602.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 0/3] t2106 vs. the default branch name","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-11-18T22:25:58Z","receivedAt":"2020-11-18T22:26:26Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 18 Nov 2020, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>\n> > The four test scripts for which I sent patch series in the past hours to\n> > remove the use of the name `master` won't be touched by v3 of this here\n> > patch series at all (because it won't be necessary anymore).\n>\n> Ah, OK.  I somehow had an impression that the big series was more or\n> less done\n\nMe, too. And if I had listened to certain people who claim that lazy\nprogrammers are the best programmers, I would have stopped there, too.\n\n> but rethinking the structure and ejecting these changes to tests that do\n> not care what name the \"init\" uses by default from the series makes a\n> lot of sense.\n\nYep.\n\nCiao,\nDscho\n"}]}