{"thread":{"id":"41803","subject":"[PATCH/GSoC 3/3] Nousage message in error","startedAt":"2016-03-24T02:03:38Z","lastAt":"2016-03-24T16:28:09Z","messageCount":5,"participants":["Diwas Joshi","Pranit Bauva","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"281628","messageId":"1458785018-29232-1-git-send-email-dj.dij123@gmail.com","threadId":"41803","inReplyTo":null,"subject":"[PATCH/GSoC 3/3] Nousage message in error","fromName":"Diwas Joshi","fromEmail":"dj.dij123@gmail.com","sentAt":"2016-03-24T02:03:38Z","receivedAt":"2016-03-24T02:03:38Z","isPatch":true,"sender":{"key":"dj.dij123@gmail.com","avatar":null},"body":"- To show only error text instead of full usage message\n- Adds exits to callback function in parse-options-cb.c instead of returning -1 which results in display of usage message.\n---\n parse-options-cb.c | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/parse-options-cb.c b/parse-options-cb.c\nindex 239898d..b7321d1 100644\n--- a/parse-options-cb.c\n+++ b/parse-options-cb.c\n@@ -85,8 +85,10 @@ int parse_opt_commits(const struct option *opt, const char *arg, int unset)\n \n \tif (!arg)\n \t\treturn -1;\n-\tif (get_sha1(arg, sha1))\n-\t\treturn error(\"malformed object name %s\", arg);\n+\tif (get_sha1(arg, sha1)) {\n+\t\terror(\"malformed object name %s\", arg);\n+\t\texit(129);\n+\t}\n \tcommit = lookup_commit_reference(sha1);\n \tif (!commit)\n \t\treturn error(\"no such commit %s\", arg);\n-- \n2.7.4\n"},{"id":"281633","messageId":"CAFZEwPN2vp+zOMdGY51LwNpgNcYxsGD4GBXHNOA8_qJ8vtE5OQ@mail.gmail.com","threadId":"41803","inReplyTo":"1458785018-29232-1-git-send-email-dj.dij123@gmail.com","subject":"Re: [PATCH/GSoC 3/3] Nousage message in error","fromName":"Pranit Bauva","fromEmail":"pranit.bauva@gmail.com","sentAt":"2016-03-24T05:14:08Z","receivedAt":"2016-03-24T05:14:08Z","isPatch":true,"sender":{"key":"pranit.bauva@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2959938?v=4"},"body":"This is my first review. It can contain some mistakes.\n\nOn Thu, Mar 24, 2016 at 7:33 AM, Diwas Joshi <dj.dij123@gmail.com> wrote:\n> Subject : [PATCH/GSoC 3/3] Nousage message in error\n\nMention about GSoC in the notes section (the one followed by the 3\ndashes ie. \"---\") rather than in the subject.\n\n> - To show only error text instead of full usage message\n> - Adds exits to callback function in parse-options-cb.c instead of returning -1 which results in display of usage message.\n\nA general convention followed by git users it to write the commit\nmessage as \"What he did to the code?\" rather than \"What problem was\nthere in the code?\" And of course after writing what you did to the\ncode, you can definitely mention what problem in the code made you do\nthis change.\n\n>  parse-options-cb.c | 6 ++++--\n>  1 file changed, 4 insertions(+), 2 deletions(-)\n>\n> diff --git a/parse-options-cb.c b/parse-options-cb.c\n> index 239898d..b7321d1 100644\n> --- a/parse-options-cb.c\n> +++ b/parse-options-cb.c\n> @@ -85,8 +85,10 @@ int parse_opt_commits(const struct option *opt, const char *arg, int unset)\n>\n>         if (!arg)\n>                 return -1;\n> -       if (get_sha1(arg, sha1))\n> -               return error(\"malformed object name %s\", arg);\n> +       if (get_sha1(arg, sha1)) {\n> +               error(\"malformed object name %s\", arg);\n> +               exit(129);\n> +       }\n>         commit = lookup_commit_reference(sha1);\n>         if (!commit)\n>                 return error(\"no such commit %s\", arg);\n\nMaybe you could describe a little more on why this change is required?\nWhy would the user want to know \"How to use the command?\" when the\nactual problem is that SHA-1 checksum has been compromised? And I\ndon't see any consumers of this method which *directly* interact with\nthe UI.\n\nIt seems that PATCH 1/3 and PATCH 2/3 are missing.\n"},{"id":"281642","messageId":"CAFZEwPM_YBD+gd0huxfi9c36imU5uG03S+x6HQQrHEVwxnMXrA@mail.gmail.com","threadId":"41803","inReplyTo":"1458785018-29232-1-git-send-email-dj.dij123@gmail.com","subject":"Re: [PATCH/GSoC 3/3] Nousage message in error","fromName":"Pranit Bauva","fromEmail":"pranit.bauva@gmail.com","sentAt":"2016-03-24T07:24:10Z","receivedAt":"2016-03-24T07:24:10Z","isPatch":true,"sender":{"key":"pranit.bauva@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2959938?v=4"},"body":"On Thu, Mar 24, 2016 at 7:33 AM, Diwas Joshi <dj.dij123@gmail.com> wrote:\n> - To show only error text instead of full usage message\n> - Adds exits to callback function in parse-options-cb.c instead of returning -1 which results in display of usage message.\n\nI forgot to mention that this microproject is already picked up by\nsomeone else. Try attempting another microproject from the list. The\nthread for the discussion of this is :\nhttp://thread.gmane.org/gmane.comp.version-control.git/289312/focus=289336\n"},{"id":"281681","messageId":"xmqqh9fvalpm.fsf@gitster.mtv.corp.google.com","threadId":"41803","inReplyTo":"CAFZEwPN2vp+zOMdGY51LwNpgNcYxsGD4GBXHNOA8_qJ8vtE5OQ@mail.gmail.com","subject":"Re: [PATCH/GSoC 3/3] Nousage message in error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-24T16:23:49Z","receivedAt":"2016-03-24T16:23:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pranit Bauva <pranit.bauva@gmail.com> writes:\n\n> A general convention followed by git users it to write the commit\n> message as \"What he did to the code?\" rather than \"What problem was\n> there in the code?\"\n\nIt is OK for other projects to adopt a different convention, but The\nproject convention here is different.\n\nWe tend to write our log message like this in this order:\n\n - Explain relevant behaviour and code structure in the current code\n   to refresh memory of readers to help them understand the next two\n   items better.  This paragraph is optional and you see it only in\n   difficult patches.\n\n - Desribe the problem.  What the end user would do and what she\n   sees in response to it, why that is not a good outcome, and what\n   would be a better outcome.  For a patch to only improve code,\n   replace \"the end user\" with \"other codepaths that interact with\n   the code being changed\".\n\n - Explain the approach to implement a better outcome.  This\n   paragraph is optional and you see it only in patches that\n   implement tricky solutions.\n\n - Describe the solution, as if you are giving orders to the\n   maintainers to change the code this way and that way.\n"},{"id":"281682","messageId":"CAFZEwPOd2RyfF5eMqB5XZqNg5Oc_fbDmERcOAMpgR81pmPOPQg@mail.gmail.com","threadId":"41803","inReplyTo":"xmqqh9fvalpm.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH/GSoC 3/3] Nousage message in error","fromName":"Pranit Bauva","fromEmail":"pranit.bauva@gmail.com","sentAt":"2016-03-24T16:28:09Z","receivedAt":"2016-03-24T16:28:09Z","isPatch":true,"sender":{"key":"pranit.bauva@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2959938?v=4"},"body":"On Thu, Mar 24, 2016 at 9:53 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Pranit Bauva <pranit.bauva@gmail.com> writes:\n>\n>> A general convention followed by git users it to write the commit\n>> message as \"What he did to the code?\" rather than \"What problem was\n>> there in the code?\"\n>\n> It is OK for other projects to adopt a different convention, but The\n> project convention here is different.\n>\n> We tend to write our log message like this in this order:\n>\n>  - Explain relevant behaviour and code structure in the current code\n>    to refresh memory of readers to help them understand the next two\n>    items better.  This paragraph is optional and you see it only in\n>    difficult patches.\n>\n>  - Desribe the problem.  What the end user would do and what she\n>    sees in response to it, why that is not a good outcome, and what\n>    would be a better outcome.  For a patch to only improve code,\n>    replace \"the end user\" with \"other codepaths that interact with\n>    the code being changed\".\n>\n>  - Explain the approach to implement a better outcome.  This\n>    paragraph is optional and you see it only in patches that\n>    implement tricky solutions.\n>\n>  - Describe the solution, as if you are giving orders to the\n>    maintainers to change the code this way and that way.\n\nThanks for making it clearer to me! I tend to write bad commit\nmessages. Improving on it though.\n"}]}