{"thread":{"id":"49788","subject":"[PATCH] p3400: replace calls to `git checkout -b' by `git checkout -B'","startedAt":"2018-11-09T21:19:37Z","lastAt":"2018-11-10T21:05:40Z","messageCount":2,"participants":["Alban Gruin","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"362839","messageId":"20181109211923.6425-1-alban.gruin@gmail.com","threadId":"49788","inReplyTo":null,"subject":"[PATCH] p3400: replace calls to `git checkout -b' by `git checkout -B'","fromName":"Alban Gruin","fromEmail":"alban.gruin@gmail.com","sentAt":"2018-11-09T21:19:23Z","receivedAt":"2018-11-09T21:19:37Z","isPatch":true,"sender":{"key":"alban.gruin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6310153?v=4"},"body":"p3400 makes a copy of the current repository to test git-rebase\nperformance, and creates new branches in the copy with `git checkout\n-b'.  If the original repository has branches with the same name as the\nscript is trying to create, this operation will fail.\n\nThis replaces these calls by `git checkout -B' to force the creation and\nupdate of these branches.\n\nSigned-off-by: Alban Gruin <alban.gruin@gmail.com>\n---\n t/perf/p3400-rebase.sh | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/perf/p3400-rebase.sh b/t/perf/p3400-rebase.sh\nindex ce271ca4c1..d202aaed06 100755\n--- a/t/perf/p3400-rebase.sh\n+++ b/t/perf/p3400-rebase.sh\n@@ -6,9 +6,9 @@ test_description='Tests rebase performance'\n test_perf_default_repo\n \n test_expect_success 'setup rebasing on top of a lot of changes' '\n-\tgit checkout -f -b base &&\n-\tgit checkout -b to-rebase &&\n-\tgit checkout -b upstream &&\n+\tgit checkout -f -B base &&\n+\tgit checkout -B to-rebase &&\n+\tgit checkout -B upstream &&\n \tfor i in $(seq 100)\n \tdo\n \t\t# simulate huge diffs\n@@ -35,8 +35,8 @@ test_perf 'rebase on top of a lot of unrelated changes' '\n \n test_expect_success 'setup rebasing many changes without split-index' '\n \tgit config core.splitIndex false &&\n-\tgit checkout -b upstream2 to-rebase &&\n-\tgit checkout -b to-rebase2 upstream\n+\tgit checkout -B upstream2 to-rebase &&\n+\tgit checkout -B to-rebase2 upstream\n '\n \n test_perf 'rebase a lot of unrelated changes without split-index' '\n-- \n2.19.1\n\n"},{"id":"362897","messageId":"nycvar.QRO.7.76.6.1811102205070.45@tvgsbejvaqbjf.bet","threadId":"49788","inReplyTo":"20181109211923.6425-1-alban.gruin@gmail.com","subject":"Re: [PATCH] p3400: replace calls to `git checkout -b' by `git checkout -B'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-11-10T21:05:42Z","receivedAt":"2018-11-10T21:05:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Alban,\n\nOn Fri, 9 Nov 2018, Alban Gruin wrote:\n\n> p3400 makes a copy of the current repository to test git-rebase\n> performance, and creates new branches in the copy with `git checkout\n> -b'.  If the original repository has branches with the same name as the\n> script is trying to create, this operation will fail.\n> \n> This replaces these calls by `git checkout -B' to force the creation and\n> update of these branches.\n\nBoth the explanation and the patch make sense to me.\n\nThanks,\nDscho\n\n> \n> Signed-off-by: Alban Gruin <alban.gruin@gmail.com>\n> ---\n>  t/perf/p3400-rebase.sh | 10 +++++-----\n>  1 file changed, 5 insertions(+), 5 deletions(-)\n> \n> diff --git a/t/perf/p3400-rebase.sh b/t/perf/p3400-rebase.sh\n> index ce271ca4c1..d202aaed06 100755\n> --- a/t/perf/p3400-rebase.sh\n> +++ b/t/perf/p3400-rebase.sh\n> @@ -6,9 +6,9 @@ test_description='Tests rebase performance'\n>  test_perf_default_repo\n>  \n>  test_expect_success 'setup rebasing on top of a lot of changes' '\n> -\tgit checkout -f -b base &&\n> -\tgit checkout -b to-rebase &&\n> -\tgit checkout -b upstream &&\n> +\tgit checkout -f -B base &&\n> +\tgit checkout -B to-rebase &&\n> +\tgit checkout -B upstream &&\n>  \tfor i in $(seq 100)\n>  \tdo\n>  \t\t# simulate huge diffs\n> @@ -35,8 +35,8 @@ test_perf 'rebase on top of a lot of unrelated changes' '\n>  \n>  test_expect_success 'setup rebasing many changes without split-index' '\n>  \tgit config core.splitIndex false &&\n> -\tgit checkout -b upstream2 to-rebase &&\n> -\tgit checkout -b to-rebase2 upstream\n> +\tgit checkout -B upstream2 to-rebase &&\n> +\tgit checkout -B to-rebase2 upstream\n>  '\n>  \n>  test_perf 'rebase a lot of unrelated changes without split-index' '\n> -- \n> 2.19.1\n> \n> \n"}]}