{"thread":{"id":"52447","subject":"[Outreachy] [PATCH] bisect--helper: convert `*_warning` char pointers to char arrays.","startedAt":"2019-12-13T20:36:34Z","lastAt":"2019-12-14T08:09:20Z","messageCount":3,"participants":["Miriam Rubio","Junio C Hamano","Miriam R."],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"388103","messageId":"20191213115225.13291-1-mirucam@gmail.com","threadId":"52447","inReplyTo":null,"subject":"[Outreachy] [PATCH] bisect--helper: convert `*_warning` char pointers to char arrays.","fromName":"Miriam Rubio","fromEmail":"mirucam@gmail.com","sentAt":"2019-12-13T11:52:25Z","receivedAt":"2019-12-13T20:36:34Z","isPatch":true,"sender":{"key":"mirucam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56339109?v=4"},"body":"From: Tanushree Tumane <tanushreetumane@gmail.com>\n\nA char array creates a character array. Its size is the number\nof elements plus one (compiler automatically adds '\\0').\nA char pointer creates a char array and a pointer to that char\narray that means four extra for bytes for the pointer variable.\n\nLet's convert `need_bad_and_good_revision_warning` and\n`need_bisect_start_warning` char pointers to char arrays.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Tanushree Tumane <tanushreetumane@gmail.com>\nSigned-off-by: Miriam Rubio <mirucam@gmail.com>\n---\nThis patch is a new version of:\nhttps://public-inbox.org/git/cadc46442d5c960caa58227092289fa2f44fb96f.1551003074.git.gitgitgadget@gmail.com/\nsent previously by Tanushree.\n\n builtin/bisect--helper.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\nindex 3055b2bb50..1718df7f09 100644\n--- a/builtin/bisect--helper.c\n+++ b/builtin/bisect--helper.c\n@@ -282,11 +282,11 @@ static int mark_good(const char *refname, const struct object_id *oid,\n \treturn 1;\n }\n \n-static const char *need_bad_and_good_revision_warning =\n+static const char need_bad_and_good_revision_warning[] =\n \tN_(\"You need to give me at least one %s and %s revision.\\n\"\n \t   \"You can use \\\"git bisect %s\\\" and \\\"git bisect %s\\\" for that.\");\n \n-static const char *need_bisect_start_warning =\n+static const char need_bisect_start_warning[] =\n \tN_(\"You need to start by \\\"git bisect start\\\".\\n\"\n \t   \"You then need to give me at least one %s and %s revision.\\n\"\n \t   \"You can use \\\"git bisect %s\\\" and \\\"git bisect %s\\\" for that.\");\n-- \n2.21.0 (Apple Git-122.2)\n\n"},{"id":"388156","messageId":"xmqqblscj8w9.fsf@gitster-ct.c.googlers.com","threadId":"52447","inReplyTo":"20191213115225.13291-1-mirucam@gmail.com","subject":"Re: [Outreachy] [PATCH] bisect--helper: convert `*_warning` char pointers to char arrays.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-12-13T19:57:42Z","receivedAt":"2019-12-13T20:41:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Miriam Rubio <mirucam@gmail.com> writes:\n\n> From: Tanushree Tumane <tanushreetumane@gmail.com>\n>\n> A char array creates a character array. Its size is the number\n> of elements plus one (compiler automatically adds '\\0').\n> A char pointer creates a char array and a pointer to that char\n> array that means four extra for bytes for the pointer variable.\n\nThis depends on the word size of your pointer and many people have\n8-byte pointers these days.  Just say\n\n\tInstead of using a pointer that points at a constant string,\n\tjust give name directly to the constant string; this way, we\n\tdo not have to allocate a pointer variable in addition to\n\tthe string we want to use.\n\nor something.\n\n> Let's convert `need_bad_and_good_revision_warning` and\n> `need_bisect_start_warning` char pointers to char arrays.\n>\n> Mentored-by: Christian Couder <chriscool@tuxfamily.org>\n> Signed-off-by: Tanushree Tumane <tanushreetumane@gmail.com>\n> Signed-off-by: Miriam Rubio <mirucam@gmail.com>\n> ---\n> This patch is a new version of:\n> https://public-inbox.org/git/cadc46442d5c960caa58227092289fa2f44fb96f.1551003074.git.gitgitgadget@gmail.com/\n> sent previously by Tanushree.\n>\n>  builtin/bisect--helper.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\n> index 3055b2bb50..1718df7f09 100644\n> --- a/builtin/bisect--helper.c\n> +++ b/builtin/bisect--helper.c\n> @@ -282,11 +282,11 @@ static int mark_good(const char *refname, const struct object_id *oid,\n>  \treturn 1;\n>  }\n>  \n> -static const char *need_bad_and_good_revision_warning =\n> +static const char need_bad_and_good_revision_warning[] =\n>  \tN_(\"You need to give me at least one %s and %s revision.\\n\"\n>  \t   \"You can use \\\"git bisect %s\\\" and \\\"git bisect %s\\\" for that.\");\n>  \n> -static const char *need_bisect_start_warning =\n> +static const char need_bisect_start_warning[] =\n>  \tN_(\"You need to start by \\\"git bisect start\\\".\\n\"\n>  \t   \"You then need to give me at least one %s and %s revision.\\n\"\n>  \t   \"You can use \\\"git bisect %s\\\" and \\\"git bisect %s\\\" for that.\");\n"},{"id":"388202","messageId":"CAN7CjDAvb0kL6tTO6UWahGDojGq_BYnTcxpBK1o7HKUi4m+JNQ@mail.gmail.com","threadId":"52447","inReplyTo":"xmqqblscj8w9.fsf@gitster-ct.c.googlers.com","subject":"Re: [Outreachy] [PATCH] bisect--helper: convert `*_warning` char pointers to char arrays.","fromName":"Miriam R.","fromEmail":"mirucam@gmail.com","sentAt":"2019-12-14T08:09:06Z","receivedAt":"2019-12-14T08:09:20Z","isPatch":true,"sender":{"key":"mirucam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56339109?v=4"},"body":"El vie., 13 dic. 2019 a las 20:57, Junio C Hamano\n(<gitster@pobox.com>) escribió:\n>\n> Miriam Rubio <mirucam@gmail.com> writes:\n>\n> > From: Tanushree Tumane <tanushreetumane@gmail.com>\n> >\n> > A char array creates a character array. Its size is the number\n> > of elements plus one (compiler automatically adds '\\0').\n> > A char pointer creates a char array and a pointer to that char\n> > array that means four extra for bytes for the pointer variable.\n>\n> This depends on the word size of your pointer and many people have\n> 8-byte pointers these days.  Just say\n>\n>         Instead of using a pointer that points at a constant string,\n>         just give name directly to the constant string; this way, we\n>         do not have to allocate a pointer variable in addition to\n>         the string we want to use.\n>\n> or something.\n\nOk, thank you, Junio. I'll send another version with the changes.\n\n>\n> > Let's convert `need_bad_and_good_revision_warning` and\n> > `need_bisect_start_warning` char pointers to char arrays.\n> >\n> > Mentored-by: Christian Couder <chriscool@tuxfamily.org>\n> > Signed-off-by: Tanushree Tumane <tanushreetumane@gmail.com>\n> > Signed-off-by: Miriam Rubio <mirucam@gmail.com>\n> > ---\n> > This patch is a new version of:\n> > https://public-inbox.org/git/cadc46442d5c960caa58227092289fa2f44fb96f.1551003074.git.gitgitgadget@gmail.com/\n> > sent previously by Tanushree.\n> >\n> >  builtin/bisect--helper.c | 4 ++--\n> >  1 file changed, 2 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\n> > index 3055b2bb50..1718df7f09 100644\n> > --- a/builtin/bisect--helper.c\n> > +++ b/builtin/bisect--helper.c\n> > @@ -282,11 +282,11 @@ static int mark_good(const char *refname, const struct object_id *oid,\n> >       return 1;\n> >  }\n> >\n> > -static const char *need_bad_and_good_revision_warning =\n> > +static const char need_bad_and_good_revision_warning[] =\n> >       N_(\"You need to give me at least one %s and %s revision.\\n\"\n> >          \"You can use \\\"git bisect %s\\\" and \\\"git bisect %s\\\" for that.\");\n> >\n> > -static const char *need_bisect_start_warning =\n> > +static const char need_bisect_start_warning[] =\n> >       N_(\"You need to start by \\\"git bisect start\\\".\\n\"\n> >          \"You then need to give me at least one %s and %s revision.\\n\"\n> >          \"You can use \\\"git bisect %s\\\" and \\\"git bisect %s\\\" for that.\");\n"}]}