{"thread":{"id":"24809","subject":"[PATCH] builtin/checkout: Fix message when switching to an existing branch","startedAt":"2010-08-20T17:41:47Z","lastAt":"2010-08-21T03:28:06Z","messageCount":6,"participants":["Ramkumar Ramachandra","Tay Ray Chuan","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"148587","messageId":"1282326107-2139-1-git-send-email-artagnon@gmail.com","threadId":"24809","inReplyTo":null,"subject":"[PATCH] builtin/checkout: Fix message when switching to an existing branch","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2010-08-20T17:41:47Z","receivedAt":"2010-08-20T17:41:47Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Fix \"Switched to a new branch <name>\" to read \"Switched to branch\n<name>\" when <name> corresponds to an existing branch. This bug was\nintroduced in 02ac983 while introducing the `-B` switch.\n\nCc: Tay Ray Chuan <rctay89@gmail.com>\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n builtin/checkout.c |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 156900d..ff5ac1e 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -545,10 +545,13 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \t\t\tif (old->path && !strcmp(new->path, old->path))\n \t\t\t\tfprintf(stderr, \"Already on '%s'\\n\",\n \t\t\t\t\tnew->name);\n-\t\t\telse\n+\t\t\telse if (opts->new_branch)\n \t\t\t\tfprintf(stderr, \"Switched to%s branch '%s'\\n\",\n \t\t\t\t\topts->branch_exists ? \" and reset\" : \" a new\",\n \t\t\t\t\tnew->name);\n+\t\t\telse\n+\t\t\t\tfprintf(stderr, \"Switched to branch '%s'\\n\",\n+\t\t\t\t\tnew->name);\n \t\t}\n \t\tif (old->path && old->name) {\n \t\t\tchar log_file[PATH_MAX], ref_file[PATH_MAX];\n-- \n1.7.2.2.408.g7357\n"},{"id":"148588","messageId":"AANLkTine1mi0AiCL+ezwNpFs4_y_szSwJd+Enux5G26Y@mail.gmail.com","threadId":"24809","inReplyTo":"1282326107-2139-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] builtin/checkout: Fix message when switching to an existing branch","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-08-20T17:46:13Z","receivedAt":"2010-08-20T17:46:13Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"On Sat, Aug 21, 2010 at 1:41 AM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Fix \"Switched to a new branch <name>\" to read \"Switched to branch\n> <name>\" when <name> corresponds to an existing branch. This bug was\n> introduced in 02ac983 while introducing the `-B` switch.\n>\n> Cc: Tay Ray Chuan <rctay89@gmail.com>\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n\nPlease see\n\n  <AANLkTi=3z9gJdT8LL3NANFyppUjvOVcrszjf5J5zAKPe@mail.gmail.com>\n\n-- \nCheers,\nRay Chuan\n"},{"id":"148590","messageId":"20100820174946.GA6211@kytes","threadId":"24809","inReplyTo":"AANLkTine1mi0AiCL+ezwNpFs4_y_szSwJd+Enux5G26Y@mail.gmail.com","subject":"Re: [PATCH] builtin/checkout: Fix message when switching to an existing branch","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2010-08-20T17:49:50Z","receivedAt":"2010-08-20T17:49:50Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi Tay,\n\nTay Ray Chuan writes:\n> On Sat, Aug 21, 2010 at 1:41 AM, Ramkumar Ramachandra\n> <artagnon@gmail.com> wrote:\n> > Fix \"Switched to a new branch <name>\" to read \"Switched to branch\n> > <name>\" when <name> corresponds to an existing branch. This bug was\n> > introduced in 02ac983 while introducing the `-B` switch.\n> >\n> > Cc: Tay Ray Chuan <rctay89@gmail.com>\n> > Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> \n> Please see\n> \n>   <AANLkTi=3z9gJdT8LL3NANFyppUjvOVcrszjf5J5zAKPe@mail.gmail.com>\n\nAh yes. It looks like I missed this earlier. Sorry for the noise.\n\n-- Ram\n"},{"id":"148592","messageId":"7v4oepcfof.fsf@alter.siamese.dyndns.org","threadId":"24809","inReplyTo":"AANLkTine1mi0AiCL+ezwNpFs4_y_szSwJd+Enux5G26Y@mail.gmail.com","subject":"Re: [PATCH] builtin/checkout: Fix message when switching to an existing branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-08-20T18:17:04Z","receivedAt":"2010-08-20T18:17:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tay Ray Chuan <rctay89@gmail.com> writes:\n\n> On Sat, Aug 21, 2010 at 1:41 AM, Ramkumar Ramachandra\n> <artagnon@gmail.com> wrote:\n>> Fix \"Switched to a new branch <name>\" to read \"Switched to branch\n>> <name>\" when <name> corresponds to an existing branch. This bug was\n>> introduced in 02ac983 while introducing the `-B` switch.\n>>\n>> Cc: Tay Ray Chuan <rctay89@gmail.com>\n>> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n>\n> Please see\n>\n>   <AANLkTi=3z9gJdT8LL3NANFyppUjvOVcrszjf5J5zAKPe@mail.gmail.com>\n\nHmm, I somehow find this version easier to read.\n"},{"id":"148619","messageId":"AANLkTim4K7LnZOhGQUNwpLR24Hm+V1fWrxY2UE2oPGx7@mail.gmail.com","threadId":"24809","inReplyTo":"1282326107-2139-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] builtin/checkout: Fix message when switching to an existing branch","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-08-21T03:15:25Z","receivedAt":"2010-08-21T03:15:25Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"On Sat, Aug 21, 2010 at 1:41 AM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n>  builtin/checkout.c |    5 ++++-\n>  1 files changed, 4 insertions(+), 1 deletions(-)\n>\n> diff --git a/builtin/checkout.c b/builtin/checkout.c\n> index 156900d..ff5ac1e 100644\n> --- a/builtin/checkout.c\n> +++ b/builtin/checkout.c\n> @@ -545,10 +545,13 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n>                        if (old->path && !strcmp(new->path, old->path))\n>                                fprintf(stderr, \"Already on '%s'\\n\",\n>                                        new->name);\n> -                       else\n> +                       else if (opts->new_branch)\n>                                fprintf(stderr, \"Switched to%s branch '%s'\\n\",\n>                                        opts->branch_exists ? \" and reset\" : \" a new\",\n>                                        new->name);\n> +                       else\n> +                               fprintf(stderr, \"Switched to branch '%s'\\n\",\n> +                                       new->name);\n\nOn a closer reading, I realise that \"reset\" isn't mentioned if the\nbranch exists.\n\nThe terser ternary version doesn't suffer from this defect.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"148620","messageId":"AANLkTin3+uAYXYsYG9DHxy9BhAg=CE5B7Oy09X7ze-OL@mail.gmail.com","threadId":"24809","inReplyTo":"AANLkTim4K7LnZOhGQUNwpLR24Hm+V1fWrxY2UE2oPGx7@mail.gmail.com","subject":"Re: [PATCH] builtin/checkout: Fix message when switching to an existing branch","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-08-21T03:28:06Z","receivedAt":"2010-08-21T03:28:06Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"On Sat, Aug 21, 2010 at 11:15 AM, Tay Ray Chuan <rctay89@gmail.com> wrote:\n> On a closer reading, I realise that \"reset\" isn't mentioned if the\n> branch exists.\n>\n> The terser ternary version doesn't suffer from this defect.\n\nSorry, please ignore that.\n\n-- \nCheers,\nRay Chuan\n"}]}