{"thread":{"id":"46151","subject":"[PATCH] wt-status.c: Modified status message shown for a parent-less branch","startedAt":"2017-06-10T01:53:15Z","lastAt":"2017-06-22T03:01:36Z","messageCount":48,"participants":["Kaartic Sivaraam","Junio C Hamano","Jeff King","Philip Oakley","Samuel Lijin","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"321869","messageId":"20170610015236.5237-1-kaarticsivaraam91196@gmail.com","threadId":"46151","inReplyTo":null,"subject":"[PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-10T01:52:36Z","receivedAt":"2017-06-10T01:53:15Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"The status message shown for a paren-less branch wasn't so\ndescriptive and was a little confusing.\n\nThe message has been changed to be more descriptive to users in\nsuch a way that it clearly shows the state of the branch / repository.\n\nThis allows the users to be reminded that they are about to make\ntheir initial commit which the previous message didn't seem to do\ncommunicate well.\n\nA few alternatives were,\n\n* No commit yet\n* Your current branch does not have any commits\n* Current branch waiting for initial commit\n\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n wt-status.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 0375484..7bfdde4 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1576,7 +1576,7 @@ static void wt_longstatus_print(struct wt_status *s)\n \n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Waiting for initial commit\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n \t}\n \n@@ -1746,7 +1746,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)\n #define LABEL(string) (s->no_gettext ? (string) : _(string))\n \n \tif (s->is_initial)\n-\t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"Initial commit on \")));\n+\t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"Waiting for initial commit on \")));\n \n \tif (!strcmp(s->branch, \"HEAD\")) {\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_NOBRANCH, s), \"%s\",\n-- \n2.7.4\n\n"},{"id":"321873","messageId":"1497060629.5324.0.camel@gmail.com","threadId":"46151","inReplyTo":"20170610015236.5237-1-kaarticsivaraam91196@gmail.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-10T02:10:29Z","receivedAt":"2017-06-10T02:10:59Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"The status message shown for a parent-less branch wasn't so\ndescriptive and was a little confusing.\n\nThe message has been changed to be more descriptive to users in\nsuch a way that it clearly shows the state of the branch / repository.\n\nThis allows the users to be reminded that they are about to make\ntheir initial commit which the previous message didn't seem to do\ncommunicate well.\n\nA few alternatives were,\n\n* No commit yet\n* Your current branch does not have any commits\n* Current branch waiting for initial commit\n\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n Corrected a little typo in the commit message\n\n\n wt-status.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 037548496..7bfdde46d 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1576,7 +1576,7 @@ static void wt_longstatus_print(struct wt_status\n*s)\n \n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\",\n\"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n_(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n_(\"Waiting for initial commit\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\",\n\"\");\n \t}\n \n@@ -1746,7 +1746,7 @@ static void wt_shortstatus_print_tracking(struct\nwt_status *s)\n #define LABEL(string) (s->no_gettext ? (string) : _(string))\n \n \tif (s->is_initial)\n-\t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"Initial\ncommit on \")));\n+\t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"Waiting\nfor initial commit on \")));\n \n \tif (!strcmp(s->branch, \"HEAD\")) {\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_NOBRANCH, s),\n\"%s\",\n-- \n2.11.0\n"},{"id":"321874","messageId":"xmqq7f0k4m3e.fsf@gitster.mtv.corp.google.com","threadId":"46151","inReplyTo":"20170610015236.5237-1-kaarticsivaraam91196@gmail.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-10T02:23:33Z","receivedAt":"2017-06-10T02:23:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:\n\n>Subject: Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch\n\n$ git shortlog -20 --no-merges\n\nmay help learning the preferred style of writing the title.  We do\nnot say \"[I] did this\".  Instead we phrase things in imperative\nmood, giving an order to the codebase to \"become like so\".  E.g.\n\n    Subject: wt-status.c: rephrase \"Initial commit\" in \"git status\" output\n\nor something like that.\n\n> The status message shown for a paren-less branch wasn't so\n> descriptive and was a little confusing.\n\ns/paren/parent/; It was descritive enough, but the problem lied\nelsewhere. It assumed that the user knows that \"git status\" message\nis relative to the next commit the user creates from the state.\n\nAnd it wasn't just \"a little\" confusing.\n\n\t\"git status\" indicated \"Initial commit\" when HEAD points at\n\tan unborn branch.  This message is shared with the commit\n\tlog template \"git commit\" prepares for the user when\n\tcreating a commit (i.e. \"You are about to create the initial\n\tcommit\"), and is OK as long as the reader is aware of the\n\tnature of the message (i.e. it guides the user working\n\ttoward the next commit), but was confusing to new users,\n\tespecially the ones who do \"git commit -m message\" without\n\thaving a chance to pay attention to the commit log template.\n\n> The message has been changed to be more descriptive to users in\n> such a way that it clearly shows the state of the branch / repository.\n\nAgain, not \"This commit did X\".\n\n\tRephrase the message so that it is more clear that the state\n\tof the current branch (not the whole repository) is being\n\tdescribed to remove this confusion.\n\n> This allows the users to be reminded that they are about to make\n> their initial commit which the previous message didn't seem to do\n> communicate well.\n\nAnd this paragraph becomes unnecessary.\n\n> A few alternatives were,\n\ns/were/considered were/;\n\n>\n> * No commit yet\n> * Your current branch does not have any commits\n> * Current branch waiting for initial commit\n>\n> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n> ---\n\nDoes this break \"git commit\", or is the update limited to \"git\nstatus\"?\n\n>  wt-status.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/wt-status.c b/wt-status.c\n> index 0375484..7bfdde4 100644\n> --- a/wt-status.c\n> +++ b/wt-status.c\n> @@ -1576,7 +1576,7 @@ static void wt_longstatus_print(struct wt_status *s)\n>  \n>  \tif (s->is_initial) {\n>  \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n> -\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n> +\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Waiting for initial commit\"));\n>  \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n>  \t}\n>  \n> @@ -1746,7 +1746,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)\n>  #define LABEL(string) (s->no_gettext ? (string) : _(string))\n>  \n>  \tif (s->is_initial)\n> -\t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"Initial commit on \")));\n> +\t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"Waiting for initial commit on \")));\n>  \n>  \tif (!strcmp(s->branch, \"HEAD\")) {\n>  \t\tcolor_fprintf(s->fp, color(WT_STATUS_NOBRANCH, s), \"%s\",\n"},{"id":"321896","messageId":"1497084241.8531.2.camel@gmail.com","threadId":"46151","inReplyTo":"xmqq7f0k4m3e.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-10T08:44:01Z","receivedAt":"2017-06-10T08:45:03Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Sat, 2017-06-10 at 11:23 +0900, Junio C Hamano wrote:\n> $ git shortlog -20 --no-merges\n> \n> may help learning the preferred style of writing the title.  We do\n> not say \"[I] did this\".  Instead we phrase things in imperative\n> mood, giving an order to the codebase to \"become like so\".  E.g.\nThis style is a little new to me thus my commit message turned out to\nbe a repercussion of my own style (which, I guess, targets other\ndevelopers who read the log). Will be careful the next time :). Made\nthe requested changes except for a few doubts they raised (see comments\nbelow).\n\n> And it wasn't just \"a little\" confusing.\n> \n> \t\"git status\" indicated \"Initial commit\" when HEAD points at\n> \tan unborn branch.  This message is shared with the commit\n> \tlog template \"git commit\" prepares for the user when\n> \tcreating a commit (i.e. \"You are about to create the initial\n> \tcommit\"),\nI didn't get that, where should I be seeing the line, \"You are about to\ncreate the initial commit\" in the commit template ? I just saw \"Initial\ncommit\" in it.\n\n> Does this break \"git commit\", or is the update limited to \"git\n> status\"?\nThis does seem to be breaking 'git commit' as it seems to be using the\noutput of 'git status'. This change results in the following commit\ntemplate for the initial commit,\n\n# Please enter the commit message for your changes. Lines starting\n# with '#' will be ignored, and an empty message aborts the commit.\n# On branch master\n#\n# Waiting for initial commit\n#\n# Changes to be committed:\n#       new file:   test-file\n#\n\nLooks odd. Not sure how to fix this. Maybe on of the alternatives have\nto be considered. \"Your current branch does not have any commits\" seems\na good one.\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n"},{"id":"321902","messageId":"1497087413.25534.1.camel@gmail.com","threadId":"46151","inReplyTo":"1497084241.8531.2.camel@gmail.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-10T09:36:53Z","receivedAt":"2017-06-10T09:37:27Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Sat, 2017-06-10 at 14:14 +0530, Kaartic Sivaraam wrote:\n> Looks odd. \nJust to be more clear by \"Looks odd\" I mean that the new status message\nlooks odd in the commit template.\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n\n"},{"id":"321908","messageId":"20170610102127.ftvko3m7gazavpj7@sigill.intra.peff.net","threadId":"46151","inReplyTo":"1497084241.8531.2.camel@gmail.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-10T10:21:27Z","receivedAt":"2017-06-10T10:21:34Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jun 10, 2017 at 02:14:01PM +0530, Kaartic Sivaraam wrote:\n\n> > Does this break \"git commit\", or is the update limited to \"git\n> > status\"?\n> This does seem to be breaking 'git commit' as it seems to be using the\n> output of 'git status'. This change results in the following commit\n> template for the initial commit,\n> \n> # Please enter the commit message for your changes. Lines starting\n> # with '#' will be ignored, and an empty message aborts the commit.\n> # On branch master\n> #\n> # Waiting for initial commit\n> #\n> # Changes to be committed:\n> #       new file:   test-file\n> #\n> \n> Looks odd. Not sure how to fix this. Maybe on of the alternatives have\n> to be considered. \"Your current branch does not have any commits\" seems\n> a good one.\n\nWe could also add an option to \"struct wt_status\" to differentiate the\ntwo cases.\n\nI had forgotten completely that this would affect git-commit. And that\nexplains the \"Initial commit\" text in the first place. This output\noriginated as the git-commit template message, and only later was moved\ninto the git-status command. And in the context of making a commit,\nsaying \"This is the initial commit\" makes a lot of sense.\n\nAnd it probably does mean we want separate messages for status and\ncommit. One is \"if you were to make a commit, it would be the first\".\nThe other is \"you are making the first commit\".\n\n-Peff\n"},{"id":"321910","messageId":"xmqqzidg14xn.fsf@gitster.mtv.corp.google.com","threadId":"46151","inReplyTo":"20170610102127.ftvko3m7gazavpj7@sigill.intra.peff.net","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-10T11:02:28Z","receivedAt":"2017-06-10T11:02:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sat, Jun 10, 2017 at 02:14:01PM +0530, Kaartic Sivaraam wrote:\n> ...\n>> # Please enter the commit message for your changes. Lines starting\n>> # with '#' will be ignored, and an empty message aborts the commit.\n>> # On branch master\n>> #\n>> # Waiting for initial commit\n>> #\n>> # Changes to be committed:\n>> #       new file:   test-file\n>> #\n>> \n>> Looks odd. Not sure how to fix this. Maybe on of the alternatives have\n>> to be considered. \"Your current branch does not have any commits\" seems\n>> a good one.\n>\n> We could also add an option to \"struct wt_status\" to differentiate the\n> two cases.\n>\n> I had forgotten completely that this would affect git-commit. And that\n> explains the \"Initial commit\" text in the first place. This output\n> originated as the git-commit template message, and only later was moved\n> into the git-status command. And in the context of making a commit,\n> saying \"This is the initial commit\" makes a lot of sense.\n>\n> And it probably does mean we want separate messages for status and\n> commit. One is \"if you were to make a commit, it would be the first\".\n> The other is \"you are making the first commit\".\n\nAgain, you said what I wanted to say in my review comment a lot\nbetter than I managed to say ;-)\n\nWhen the current message \"Initial commit\" is read in the context\ntogether with \"Changes to be committed\", etc., by users of \"git\ncommit\" who do not use the \"-m message\" option, it is clear that\nthese are talking about the commit the user is about to make.  \n\nThe confusion factor that triggered the discussion in the thread\nthat resulted in this patch exists because the output from \"git\nstatus\" uses phrases that are designed to guide the user in working\ntoward creating the next commit on the branch, even though the user\nmay not be thinking in terms of \"what would happen when I say\n'commit' now?\"\n\nAnd I do not think the potential confusion is limited to \"Initial\ncommit\" from that point of view.  The files listed in \"Changes to be\ncommitted\" list are not files to be \"committed\", UNLESS the user is\naware that s/he is asking \"what would happen when I say 'commit'\nnow?\".  When the question is \"what is the status of my working area?\",\nthat phrase in the section header is suboptimal.\n\nAdding a bit to \"struct wt_status\" is a good first step to allow all\nthree (i.e. in addition to \"Initial commit\" and \"Changes to be\ncommitted\", \"Changes not staged for commit\" is the other one that\nshares this potential confusion factor) to be phrased in a way that\nis more appropriate in an answer to the question \"what is the status\nof my working area?\", I would think.\n\nThanks.\n\n\n"},{"id":"321928","messageId":"0E6CC91ED74848B78F9A2DFC7DF48AE5@PhilipOakley","threadId":"46151","inReplyTo":"1497084241.8531.2.camel@gmail.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2017-06-10T14:44:08Z","receivedAt":"2017-06-10T14:44:15Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Kaartic Sivaraam\" <kaarticsivaraam91196@gmail.com>\n> On Sat, 2017-06-10 at 11:23 +0900, Junio C Hamano wrote:\n>> $ git shortlog -20 --no-merges\n>>\n>> may help learning the preferred style of writing the title. We do\n>> not say \"[I] did this\". Instead we phrase things in imperative\n>> mood, giving an order to the codebase to \"become like so\". E.g.\n> This style is a little new to me thus my commit message turned out to\n> be a repercussion of my own style (which, I guess, targets other\n> developers who read the log). Will be careful the next time :). Made\n> the requested changes except for a few doubts they raised (see comments\n> below).\n>\n>> And it wasn't just \"a little\" confusing.\n>>\n>> \"git status\" indicated \"Initial commit\" when HEAD points at\n>> an unborn branch. This message is shared with the commit\n>> log template \"git commit\" prepares for the user when\n>> creating a commit (i.e. \"You are about to create the initial\n>> commit\"),\n> I didn't get that, where should I be seeing the line, \"You are about to\n> create the initial commit\" in the commit template ? I just saw \"Initial\n> commit\" in it.\n>\n>> Does this break \"git commit\", or is the update limited to \"git\n>> status\"?\n> This does seem to be breaking 'git commit' as it seems to be using the\n> output of 'git status'. This change results in the following commit\n> template for the initial commit,\n>\n> # Please enter the commit message for your changes. Lines starting\n> # with '#' will be ignored, and an empty message aborts the commit.\n> # On branch master\n> #\n> # Waiting for initial commit\n\nTo me this sounds perfectly natural. It is the current status. The line will \nbe ignored by the commit message anyway unless the user edits the start of \nthe line.\n\nAt most it is a feeling that maybe we should provide an imperative \nstatement, but even then, it's still stating the obvious (which is normally \na bad thing). If the user is adding a .gitignore file then the commit \nmessage should say so, etc. Maybe the \"Initial commit\" is meant to be the \ndefault (by convention) separator, or its just a convention we've become \nused to.\n\n> #\n> # Changes to be committed:\n> # new file: test-file\n> #\n>\n> Looks odd. Not sure how to fix this. Maybe on of the alternatives have\n> to be considered. \"Your current branch does not have any commits\" seems\n> a good one.\n>\n> -- \n> Regards,\n> Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n\n--\nPhilip \n\n"},{"id":"321952","messageId":"1497255003.1718.1.camel@gmail.com","threadId":"46151","inReplyTo":"xmqqzidg14xn.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-12T08:10:03Z","receivedAt":"2017-06-12T08:10:35Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Sat, 2017-06-10 at 20:02 +0900, Junio C Hamano wrote:\n> Again, you said what I wanted to say in my review comment a lot\n> better than I managed to say ;-)\n> \n> When the current message \"Initial commit\" is read in the context\n> together with \"Changes to be committed\", etc., by users of \"git\n> commit\" who do not use the \"-m message\" option, it is clear that\n> these are talking about the commit the user is about to make.  \n> \n> The confusion factor that triggered the discussion in the thread\n> that resulted in this patch exists because the output from \"git\n> status\" uses phrases that are designed to guide the user in working\n> toward creating the next commit on the branch, even though the user\n> may not be thinking in terms of \"what would happen when I say\n> 'commit' now?\"\n> \n> And I do not think the potential confusion is limited to \"Initial\n> commit\" from that point of view.  The files listed in \"Changes to be\n> committed\" list are not files to be \"committed\", UNLESS the user is\n> aware that s/he is asking \"what would happen when I say 'commit'\n> now?\".  When the question is \"what is the status of my working\n> area?\",\n> that phrase in the section header is suboptimal.\n> \n> Adding a bit to \"struct wt_status\" is a good first step to allow all\n> three (i.e. in addition to \"Initial commit\" and \"Changes to be\n> committed\", \"Changes not staged for commit\" is the other one that\n> shares this potential confusion factor) to be phrased in a way that\n> is more appropriate in an answer to the question \"what is the status\n> of my working area?\", I would think.\n> \n> Thanks.\n> \nIt seems that the current change has to be discarded altogether and\nfurther the change required doesn't look trivial. This seems to warrant\nsome bit of research of the code base. As a first step I would like to\nknow which part of the code base creates the commit template. I guess\nmuch can't be done without knowing how it's created.\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n"},{"id":"321980","messageId":"xmqqa85dnjpz.fsf@gitster.mtv.corp.google.com","threadId":"46151","inReplyTo":"1497255003.1718.1.camel@gmail.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-12T18:28:56Z","receivedAt":"2017-06-12T18:29:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:\n\n>> Adding a bit to \"struct wt_status\" is a good first step to allow all\n>> three (i.e. in addition to \"Initial commit\" and \"Changes to be\n>> committed\", \"Changes not staged for commit\" is the other one that\n>> shares this potential confusion factor) to be phrased in a way that\n>> is more appropriate in an answer to the question \"what is the status\n>> of my working area?\", I would think.\n>> \n>> Thanks.\n>> \n> It seems that the current change has to be discarded altogether and\n> further the change required doesn't look trivial. This seems to warrant\n> some bit of research of the code base. As a first step I would like to\n> know which part of the code base creates the commit template. I guess\n> much can't be done without knowing how it's created.\n\nPerhaps something along this line (warning: not even compile\ntested)?\n\n builtin/commit.c |  1 +\n wt-status.c      | 15 ++++++++++++---\n wt-status.h      |  1 +\n 3 files changed, 14 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex da1ba4c862..ffb2d71d3d 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1652,6 +1652,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n \n \tstatus_init_config(&s, git_commit_config);\n+\ts.commit_template = 1;\n \tstatus_format = STATUS_FORMAT_NONE; /* Ignore status.short */\n \ts.colopts = 0;\n \ndiff --git a/wt-status.c b/wt-status.c\nindex 25aafc35c8..006aaf9e76 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -196,7 +196,10 @@ static void wt_longstatus_print_cached_header(struct wt_status *s)\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tstatus_printf_ln(s, c, _(\"Changes to be committed:\"));\n+\tif (s->commit_template)\n+\t\tstatus_printf_ln(s, c, _(\"Changes to be committed:\"));\n+\telse\n+\t\tstatus_printf_ln(s, c, _(\"Changes already in the index:\"));\n \tif (!s->hints)\n \t\treturn;\n \tif (s->whence != FROM_COMMIT)\n@@ -214,7 +217,10 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n+\tif (s->commit_template)\n+\t\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n+\telse\n+\t\tstatus_printf_ln(s, c, _(\"Changes not yet in the index:\"));\n \tif (!s->hints)\n \t\treturn;\n \tif (!has_deleted)\n@@ -1578,7 +1584,10 @@ static void wt_longstatus_print(struct wt_status *s)\n \n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n+\t\t\t\t s->commit_template\n+\t\t\t\t ? _(\"Initial commit\")\n+\t\t\t\t : _(\"No commit yet on the branch\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n \t}\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 8a3864783b..17f72f2346 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -77,6 +77,7 @@ struct wt_status {\n \tunsigned colopts;\n \tint null_termination;\n \tint show_branch;\n+\tint commit_template;\n \tint hints;\n \n \tenum wt_status_format status_format;\n"},{"id":"321993","messageId":"20170612212025.ytyukvmmthfcsejh@sigill.intra.peff.net","threadId":"46151","inReplyTo":"xmqqa85dnjpz.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-12T21:20:26Z","receivedAt":"2017-06-12T21:20:38Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 12, 2017 at 11:28:56AM -0700, Junio C Hamano wrote:\n\n> Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:\n> \n> >> Adding a bit to \"struct wt_status\" is a good first step to allow all\n> >> three (i.e. in addition to \"Initial commit\" and \"Changes to be\n> >> committed\", \"Changes not staged for commit\" is the other one that\n> >> shares this potential confusion factor) to be phrased in a way that\n> >> is more appropriate in an answer to the question \"what is the status\n> >> of my working area?\", I would think.\n> >> \n> >> Thanks.\n> >> \n> > It seems that the current change has to be discarded altogether and\n> > further the change required doesn't look trivial. This seems to warrant\n> > some bit of research of the code base. As a first step I would like to\n> > know which part of the code base creates the commit template. I guess\n> > much can't be done without knowing how it's created.\n> \n> Perhaps something along this line (warning: not even compile\n> tested)?\n\nSo I think the addition of the bit here is obviously correct, and I'm\nnot opposed to the idea of giving wt-status more information so that it\ncan make better messages. But I'm not sure it's actually helping for\nsome of these cases. E.g.:\n\n> -\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n> +\tif (s->commit_template)\n> +\t\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n> +\telse\n> +\t\tstatus_printf_ln(s, c, _(\"Changes not yet in the index:\"));\n\nI think \"staged for commit\" still makes perfect sense even when we are\njust asking \"what's the current status\" and not \"what would it look like\nif I were to commit\".\n\nAnd avoiding the word \"index\" is worth-while here, I think. I am not in\ngeneral of the \"let's hide the index\" camp\" but it is a technical term.\nIf we can say the same thing in a way that is understood both by people\nwho know what the index is and people who do not, that seems like a win.\n\n> -\tstatus_printf_ln(s, c, _(\"Changes to be committed:\"));\n> +\tif (s->commit_template)\n> +\t\tstatus_printf_ln(s, c, _(\"Changes to be committed:\"));\n> +\telse\n> +\t\tstatus_printf_ln(s, c, _(\"Changes already in the index:\"));\n\nThis one is less obvious, because \"to be committed\" more strongly\nimplies making an actual commit. At the same time, I don't think it's\nunclear what it means in the context of status. It could be \"Changes\nstaged for commit\" to match the other \"not staged\" message, though I\nthink I prefer the existing wording.\n\n> @@ -1578,7 +1584,10 @@ static void wt_longstatus_print(struct wt_status *s)\n>  \n>  \tif (s->is_initial) {\n>  \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n> -\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n> +\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n> +\t\t\t\t s->commit_template\n> +\t\t\t\t ? _(\"Initial commit\")\n> +\t\t\t\t : _(\"No commit yet on the branch\"));\n\nThis one I think is an improvement. :)\n\n-Peff\n"},{"id":"321998","messageId":"xmqqshj4nb9u.fsf@gitster.mtv.corp.google.com","threadId":"46151","inReplyTo":"20170612212025.ytyukvmmthfcsejh@sigill.intra.peff.net","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-12T21:31:25Z","receivedAt":"2017-06-12T21:31:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> .... But I'm not sure it's actually helping for\n> some of these cases. E.g.:\n>\n>> -\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n>> +\tif (s->commit_template)\n>> +\t\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n>> +\telse\n>> +\t\tstatus_printf_ln(s, c, _(\"Changes not yet in the index:\"));\n>\n> I think \"staged for commit\" still makes perfect sense even when we are\n> just asking \"what's the current status\" and not \"what would it look like\n> if I were to commit\".\n>\n> And avoiding the word \"index\" is worth-while here, I think. I am not in\n> general of the \"let's hide the index\" camp\" but it is a technical term.\n> If we can say the same thing in a way that is understood both by people\n> who know what the index is and people who do not, that seems like a win.\n\nI do not mind \"Changes not staged yet:\".  The point was not about\ngetting rid of \"stage\" but about not mentioning \"commit\", because\nstepping back a bit, if the readers are prepared to accept these\nmessages in the mindset that they are guiding them toward their next\ncommit, \"I find 'Initial commit' confusing\" would not have been an\nissue in the first place.\n\n>> -\tstatus_printf_ln(s, c, _(\"Changes to be committed:\"));\n>> +\tif (s->commit_template)\n>> +\t\tstatus_printf_ln(s, c, _(\"Changes to be committed:\"));\n>> +\telse\n>> +\t\tstatus_printf_ln(s, c, _(\"Changes already in the index:\"));\n>\n> This one is less obvious, because \"to be committed\" more strongly\n> implies making an actual commit.\n\nAgain, I do not mind \"Changes already staged:\" too much.\n\nIf we can get rid of 'yet' and 'already' from the above two, that\nwould be even better.  The point of the exercise is to be understood\nby those who do not think in terms of 'preparing for the next commit',\nso 'yet', 'already', 'to be committed' are all counter-productive\nfor that goal.  Those who accept the 'description of the current\nstate in the context of preparing for the next commit' are not the\nones we are trying to help with the suggested three changes.\n\n>> @@ -1578,7 +1584,10 @@ static void wt_longstatus_print(struct wt_status *s)\n>>  \n>>  \tif (s->is_initial) {\n>>  \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n>> -\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n>> +\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n>> +\t\t\t\t s->commit_template\n>> +\t\t\t\t ? _(\"Initial commit\")\n>> +\t\t\t\t : _(\"No commit yet on the branch\"));\n>\n> This one I think is an improvement. :)\n>\n> -Peff\n"},{"id":"322004","messageId":"20170612213759.f2scl3r46vboolna@sigill.intra.peff.net","threadId":"46151","inReplyTo":"xmqqshj4nb9u.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-12T21:37:59Z","receivedAt":"2017-06-12T21:38:21Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 12, 2017 at 02:31:25PM -0700, Junio C Hamano wrote:\n\n> >> -\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n> >> +\tif (s->commit_template)\n> >> +\t\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n> >> +\telse\n> >> +\t\tstatus_printf_ln(s, c, _(\"Changes not yet in the index:\"));\n> >\n> > I think \"staged for commit\" still makes perfect sense even when we are\n> > just asking \"what's the current status\" and not \"what would it look like\n> > if I were to commit\".\n> >\n> > And avoiding the word \"index\" is worth-while here, I think. I am not in\n> > general of the \"let's hide the index\" camp\" but it is a technical term.\n> > If we can say the same thing in a way that is understood both by people\n> > who know what the index is and people who do not, that seems like a win.\n> \n> I do not mind \"Changes not staged yet:\".  The point was not about\n> getting rid of \"stage\" but about not mentioning \"commit\", because\n> stepping back a bit, if the readers are prepared to accept these\n> messages in the mindset that they are guiding them toward their next\n> commit, \"I find 'Initial commit' confusing\" would not have been an\n> issue in the first place.\n\nI think the difference is that \"Initial commit\" is talking about a\n_specific_ commit. If we're not working on one, it doesn't make much\nsense. But \"staged for commit\" is not necessarily talking about a\nspecific commit; we are talking about the purpose of staging something\nin general. You could equally well say \"staged for committing\" (though I\nthink the shorter word sounds more natural).\n\nLikewise with \"to be committed\".\n\n> If we can get rid of 'yet' and 'already' from the above two, that\n> would be even better.  The point of the exercise is to be understood\n> by those who do not think in terms of 'preparing for the next commit',\n> so 'yet', 'already', 'to be committed' are all counter-productive\n> for that goal.  Those who accept the 'description of the current\n> state in the context of preparing for the next commit' are not the\n> ones we are trying to help with the suggested three changes.\n\nI agree that is the goal. My point was that the existing messages are OK\neven if you aren't thinking of preparing for the next commit. Saying\n\"this is in the index\" and \"this is staged\" are synonyms. Saying \"this\nis staged for commit\" is likewise a synonym, unless there is some other\nreason we stage things.\n\n-Peff\n"},{"id":"322299","messageId":"1497514760.2394.6.camel@gmail.com","threadId":"46151","inReplyTo":"20170612213759.f2scl3r46vboolna@sigill.intra.peff.net","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-15T08:19:20Z","receivedAt":"2017-06-15T08:19:47Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Mon, 2017-06-12 at 17:37 -0400, Jeff King wrote:\n> On Mon, Jun 12, 2017 at 02:31:25PM -0700, Junio C Hamano wrote:\n> > > I think \"staged for commit\" still makes perfect sense even when\n> > > we are\n> > > just asking \"what's the current status\" and not \"what would it\n> > > look like\n> > > if I were to commit\".\n> > > \n> > > And avoiding the word \"index\" is worth-while here, I think. I am\n> > > not in\n> > > general of the \"let's hide the index\" camp\" but it is a technical\n> > > term.\n> > > If we can say the same thing in a way that is understood both by\n> > > people\n> > > who know what the index is and people who do not, that seems like\n> > > a win.\n> > \n> > I do not mind \"Changes not staged yet:\".  The point was not about\n> > getting rid of \"stage\" but about not mentioning \"commit\", because\n> > stepping back a bit, if the readers are prepared to accept these\n> > messages in the mindset that they are guiding them toward their\n> > next\n> > commit, \"I find 'Initial commit' confusing\" would not have been an\n> > issue in the first place.\n> \n> I think the difference is that \"Initial commit\" is talking about a\n> _specific_ commit. If we're not working on one, it doesn't make much\n> sense. But \"staged for commit\" is not necessarily talking about a\n> specific commit; we are talking about the purpose of staging\n> something\n> in general. You could equally well say \"staged for committing\"\n> (though I\n> think the shorter word sounds more natural).\n> \n> Likewise with \"to be committed\".\n> \n> > If we can get rid of 'yet' and 'already' from the above two, that\n> > would be even better.  The point of the exercise is to be\n> > understood\n> > by those who do not think in terms of 'preparing for the next\n> > commit',\n> > so 'yet', 'already', 'to be committed' are all counter-productive\n> > for that goal.  Those who accept the 'description of the current\n> > state in the context of preparing for the next commit' are not the\n> > ones we are trying to help with the suggested three changes.\n> \n> I agree that is the goal. My point was that the existing messages are\n> OK\n> even if you aren't thinking of preparing for the next commit. Saying\n> \"this is in the index\" and \"this is staged\" are synonyms. Saying\n> \"this\n> is staged for commit\" is likewise a synonym, unless there is some\n> other\n> reason we stage things.\n> \n> -Peff\nWhat about, \"not making any assumptions\" about what the user would\nthink when he views the output of `git status` ? Why not try some\ngeneral messages like, \n\n* Staged changes\n* Unstaged changes\n\ninstead of the messages such as \n\n* Changes to be committed, Changes already in the index\n* Changes not staged for commit, Changes not yet in the index\n\nwhich seem to make assumptions about the user who view the output ?\n\nA typical patch could be found below,\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 1d805f5da..3ed8e40bc 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1364,6 +1364,7 @@ int cmd_status(int argc, const char **argv, const\nchar *prefix)\n \t\tusage_with_options(builtin_status_usage,\nbuiltin_status_options);\n \n \tstatus_init_config(&s, git_status_config);\n+\ts.commit_template = 1;\n \targc = parse_options(argc, argv, prefix,\n \t\t\t     builtin_status_options,\n \t\t\t     builtin_status_usage, 0);\ndiff --git a/wt-status.c b/wt-status.c\nindex 037548496..55a7bd757 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -196,9 +196,14 @@ static void\nwt_longstatus_print_cached_header(struct wt_status *s)\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tstatus_printf_ln(s, c, _(\"Changes to be committed:\"));\n+\tif (s->commit_template)\n+\t\tstatus_printf_ln(s, c, _(\"Changes to be committed:\"));\n+\telse\n+\t\tstatus_printf_ln(s, c, _(\"Staged changes:\"));\n+\n \tif (!s->hints)\n \t\treturn;\n+\n \tif (s->whence != FROM_COMMIT)\n \t\t; /* NEEDSWORK: use \"git reset --unresolve\"??? */\n \telse if (!s->is_initial)\n@@ -214,7 +219,11 @@ static void\nwt_longstatus_print_dirty_header(struct wt_status *s,\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n+\tif (s->commit_template)\n+\t\tstatus_printf_ln(s, c, _(\"Changes not staged for\ncommit:\"));\n+\telse\n+\t\tstatus_printf_ln(s, c, _(\"Unstaged changes:\"));\n+\n \tif (!s->hints)\n \t\treturn;\n \tif (!has_deleted)\n@@ -1576,7 +1585,10 @@ static void wt_longstatus_print(struct wt_status\n*s)\n \n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\",\n\"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n_(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n+\t\t\t\t s->commit_template\n+\t\t\t\t ? _(\"Initial commit\")\n+\t\t\t\t : _(\"No commits yet on the branch\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\",\n\"\");\n \t}\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 6018c627b..38bb24ef3 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -77,6 +77,7 @@ struct wt_status {\n \tunsigned colopts;\n \tint null_termination;\n \tint show_branch;\n+\tint commit_template;\n \tint hints;\n \n \tenum wt_status_format status_format;\n"},{"id":"322300","messageId":"20170615084248.elfsh4of5qdsk3pa@sigill.intra.peff.net","threadId":"46151","inReplyTo":"1497514760.2394.6.camel@gmail.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-15T08:42:48Z","receivedAt":"2017-06-15T08:42:54Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 15, 2017 at 01:49:20PM +0530, Kaartic Sivaraam wrote:\n\n> What about, \"not making any assumptions\" about what the user would\n> think when he views the output of `git status` ? Why not try some\n> general messages like, \n> \n> * Staged changes\n> * Unstaged changes\n> \n> instead of the messages such as \n> \n> * Changes to be committed, Changes already in the index\n> * Changes not staged for commit, Changes not yet in the index\n> \n> which seem to make assumptions about the user who view the output ?\n\nSaying just \"staged changes\" is definitely accurate. I don't know if\nsome users would find that too terse, too. The phrase \"not staged for\ncommit\" gives more information if you don't know what \"staged\" means in\nthe Git world.\n\n-Peff\n"},{"id":"322314","messageId":"CAJZjrdXXGb-QrvJW9JusPT597QDnQD_shzVJq-5GN=hZCBJYeA@mail.gmail.com","threadId":"46151","inReplyTo":"20170615084248.elfsh4of5qdsk3pa@sigill.intra.peff.net","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Samuel Lijin","fromEmail":"sxlijin@gmail.com","sentAt":"2017-06-15T11:43:17Z","receivedAt":"2017-06-15T11:44:04Z","isPatch":true,"sender":{"key":"sxlijin@gmail.com","avatar":"https://gravatar.com/avatar/01777bf1eae64e2b4dca97dcac182a6abbcf6fd8cb4d5b8fa33edf9f8cc21746?d=mp&s=160"},"body":"On Thu, Jun 15, 2017 at 4:42 AM, Jeff King <peff@peff.net> wrote:\n>\n> On Thu, Jun 15, 2017 at 01:49:20PM +0530, Kaartic Sivaraam wrote:\n>\n> > What about, \"not making any assumptions\" about what the user would\n> > think when he views the output of `git status` ? Why not try some\n> > general messages like,\n> >\n> > * Staged changes\n> > * Unstaged changes\n> >\n> > instead of the messages such as\n> >\n> > * Changes to be committed, Changes already in the index\n> > * Changes not staged for commit, Changes not yet in the index\n> >\n> > which seem to make assumptions about the user who view the output ?\n>\n> Saying just \"staged changes\" is definitely accurate. I don't know if\n> some users would find that too terse, too. The phrase \"not staged for\n> commit\" gives more information if you don't know what \"staged\" means in\n> the Git world.\n\nPerhaps there should be a message pointing people at documentation\nexplaining the index and staging terminology?\n\nOffhand, this is something I was wondering about the other day - has\nthere ever been a discussion of what level of proficiency Git expects\nof its users?\n\n> -Peff\n"},{"id":"322320","messageId":"20170615131245.zh5nuipmaadcfpdx@sigill.intra.peff.net","threadId":"46151","inReplyTo":"CAJZjrdXXGb-QrvJW9JusPT597QDnQD_shzVJq-5GN=hZCBJYeA@mail.gmail.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-15T13:12:45Z","receivedAt":"2017-06-15T13:13:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 15, 2017 at 07:43:17AM -0400, Samuel Lijin wrote:\n\n> > Saying just \"staged changes\" is definitely accurate. I don't know if\n> > some users would find that too terse, too. The phrase \"not staged for\n> > commit\" gives more information if you don't know what \"staged\" means in\n> > the Git world.\n\nOops, I meant to say \"too terse, though\". But it sounds like you got my\nmeaning.\n\n> Perhaps there should be a message pointing people at documentation\n> explaining the index and staging terminology?\n\nMaybe. I wouldn't want this message to get too verbose. People see it a\nlot. There advice.statusHints message is already pretty verbose (though\nI turned it off myself years ago).\n\n> Offhand, this is something I was wondering about the other day - has\n> there ever been a discussion of what level of proficiency Git expects\n> of its users?\n\nThere have been lots of discussions, but none that I can think of as\ndefinitive.\n\nI think the general strategy these days is to try to give hints via\nadvise() for confusing situations, and to make it possible for expert\nusers to turn those off.\n\nIn general, I think using words from \"git help glossary\" is OK, but when\nwe can use plainer language without loss of precision, that seems like a\ngood idea. That's just my personal opinion, though.\n\n-Peff\n"},{"id":"322448","messageId":"1497609408.2517.4.camel@gmail.com","threadId":"46151","inReplyTo":"20170615131245.zh5nuipmaadcfpdx@sigill.intra.peff.net","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-16T10:36:48Z","receivedAt":"2017-06-16T10:37:14Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"\nOn Thu, 2017-06-15 at 09:12 -0400, Jeff King wrote:\n> On Thu, Jun 15, 2017 at 07:43:17AM -0400, Samuel Lijin wrote:\n> \n> > > Saying just \"staged changes\" is definitely accurate. I don't know\n> > > if\n> > > some users would find that too terse, too. The phrase \"not staged\n> > > for\n> > > commit\" gives more information if you don't know what \"staged\"\n> > > means in\n> > > the Git world.\n> \n> Oops, I meant to say \"too terse, though\". But it sounds like you got\n> my\n> meaning.\n> \nFrom what I could get from this thread, I guess the current patch\nstands something like the one below. I tried building it with the below\nchange, it seems to be having a little issue. I'm not sure why, it\nseems to be working the other way round i.e., the message \"No commits\nyet on the branch\" message is shown in the commit template and the\nmessage \"Initial commit\" is shown when `git status` is invoked.\n\nAlso, let me know if any other change is required.\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 1d805f5da..3ed8e40bc 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1364,6 +1364,7 @@ int cmd_status(int argc, const char **argv, const\nchar *prefix)\n                usage_with_options(builtin_status_usage,\nbuiltin_status_options);\n \n        status_init_config(&s, git_status_config);\n+       s.commit_template = 1;\n        argc = parse_options(argc, argv, prefix,\n                             builtin_status_options,\n                             builtin_status_usage, 0);\ndiff --git a/wt-status.c b/wt-status.c\nindex 037548496..34aa1af66 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1576,7 +1576,10 @@ static void wt_longstatus_print(struct wt_status\n*s)\n \n        if (s->is_initial) {\n                status_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\",\n\"\");\n-               status_printf_ln(s, color(WT_STATUS_HEADER, s),\n_(\"Initial commit\"));\n+               status_printf_ln(s, color(WT_STATUS_HEADER, s),\n+                                s->commit_template\n+                                ? _(\"Initial commit\")\n+                                : _(\"No commits yet on the branch\"));\n                status_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\",\n\"\");\n        }\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 6018c627b..782b2997f 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -76,6 +76,7 @@ struct wt_status {\n        char color_palette[WT_STATUS_MAXSLOT][COLOR_MAXLEN];\n        unsigned colopts;\n        int null_termination;\n+       int commit_template;\n        int show_branch;\n        int hints;\n"},{"id":"322449","messageId":"20170616105032.rjmmql56ifol34mk@sigill.intra.peff.net","threadId":"46151","inReplyTo":"1497609408.2517.4.camel@gmail.com","subject":"Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-16T10:50:32Z","receivedAt":"2017-06-16T10:50:40Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jun 16, 2017 at 04:06:48PM +0530, Kaartic Sivaraam wrote:\n\n> From what I could get from this thread, I guess the current patch\n> stands something like the one below. I tried building it with the below\n> change, it seems to be having a little issue. I'm not sure why, it\n> seems to be working the other way round i.e., the message \"No commits\n> yet on the branch\" message is shown in the commit template and the\n> message \"Initial commit\" is shown when `git status` is invoked.\n> \n> Also, let me know if any other change is required.\n> \n> diff --git a/builtin/commit.c b/builtin/commit.c\n> index 1d805f5da..3ed8e40bc 100644\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -1364,6 +1364,7 @@ int cmd_status(int argc, const char **argv, const\n> char *prefix)\n>                 usage_with_options(builtin_status_usage,\n> builtin_status_options);\n>  \n>         status_init_config(&s, git_status_config);\n> +       s.commit_template = 1;\n>         argc = parse_options(argc, argv, prefix,\n>                              builtin_status_options,\n>                              builtin_status_usage, 0);\n\nWouldn't you want this in cmd_commit(), not cmd_status()?\n\n-Peff\n"},{"id":"322515","messageId":"1497771338.1689.4.camel@gmail.com","threadId":"46151","inReplyTo":"20170616105032.rjmmql56ifol34mk@sigill.intra.peff.net","subject":"Re: [PATCH/Almost final] wt-status.c: Modified status message shown for a parent-less branch","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-18T07:35:38Z","receivedAt":"2017-06-18T07:36:01Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Fri, 2017-06-16 at 06:50 -0400, Jeff King wrote:\n> Wouldn't you want this in cmd_commit(), not cmd_status()?\n> \nThat's right. I made a little mistake while trying to replicate a\nchange specified by Mr. Junio C. Hamano in a previous mail in this\nthread. \n\nSeems there aren't any other changes required as far as I could see,\nhence this mail will follow with an \"almost final\" patch.\n\n--\nRegards,\nKaartic\n"},{"id":"322517","messageId":"20170618075301.6431-1-kaarticsivaraam91196@gmail.com","threadId":"46151","inReplyTo":"1497771338.1689.4.camel@gmail.com","subject":"[PATCH/ALMOST FINAL] Contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-18T07:53:01Z","receivedAt":"2017-06-18T07:53:31Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"\"git status\" indicated \"Initial commit\" when HEAD points at\nan unborn branch.  This message is shared with the commit\nlog template \"git commit\" prepares for the user when\ncreating a commit (i.e. \"You are about to create the initial\ncommit\"), and is OK as long as the reader is aware of the\nnature of the message (i.e. it guides the user working\ntoward the next commit), but was confusing to new users,\nespecially the ones who do \"git commit -m message\" without\nhaving a chance to pay attention to the commit log template.\n\nThe \"Initial commit\" indication wasn't an issue in the commit\ntemplate. Taking that into consideration, a good solution would\nbe to contextually use different messages to indicate the user\nthat there were no commits in this branch.\n\nA few alternatives considered were,\n\n* Waiting for initial commit\n* Your current branch does not have any commits\n* Current branch waiting for initial commit\n\nPatch-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n builtin/commit.c | 1 +\n wt-status.c      | 5 ++++-\n wt-status.h      | 1 +\n 3 files changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 1d805f5da..0f36d2ac3 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1648,6 +1648,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n \n \tstatus_init_config(&s, git_commit_config);\n+\ts.commit_template = 1;\n \tstatus_format = STATUS_FORMAT_NONE; /* Ignore status.short */\n \ts.colopts = 0;\n \ndiff --git a/wt-status.c b/wt-status.c\nindex 037548496..34aa1af66 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1576,7 +1576,10 @@ static void wt_longstatus_print(struct wt_status *s)\n \n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n+\t\t\t\t s->commit_template\n+\t\t\t\t ? _(\"Initial commit\")\n+\t\t\t\t : _(\"No commits yet on the branch\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n \t}\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 6018c627b..782b2997f 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -76,6 +76,7 @@ struct wt_status {\n \tchar color_palette[WT_STATUS_MAXSLOT][COLOR_MAXLEN];\n \tunsigned colopts;\n \tint null_termination;\n+\tint commit_template;\n \tint show_branch;\n \tint hints;\n \n-- \n2.11.0\n\n"},{"id":"322518","messageId":"87shix8zik.fsf@gmail.com","threadId":"46151","inReplyTo":"20170618075301.6431-1-kaarticsivaraam91196@gmail.com","subject":"Re: [PATCH/ALMOST FINAL] Contextually notify user about an initial commit","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-18T08:34:59Z","receivedAt":"2017-06-18T08:35:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sun, Jun 18 2017, Kaartic Sivaraam jotted:\n\n> \"git status\" indicated \"Initial commit\" when HEAD points at\n> an unborn branch.  This message is shared with the commit\n> log template \"git commit\" prepares for the user when\n> creating a commit (i.e. \"You are about to create the initial\n> commit\"), and is OK as long as the reader is aware of the\n> nature of the message (i.e. it guides the user working\n> toward the next commit), but was confusing to new users,\n> especially the ones who do \"git commit -m message\" without\n> having a chance to pay attention to the commit log template.\n>\n> The \"Initial commit\" indication wasn't an issue in the commit\n> template. Taking that into consideration, a good solution would\n> be to contextually use different messages to indicate the user\n> that there were no commits in this branch.\n>\n> A few alternatives considered were,\n>\n> * Waiting for initial commit\n> * Your current branch does not have any commits\n> * Current branch waiting for initial commit\n>\n> Patch-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n> ---\n>  builtin/commit.c | 1 +\n>  wt-status.c      | 5 ++++-\n>  wt-status.h      | 1 +\n>  3 files changed, 6 insertions(+), 1 deletion(-)\n>\n> diff --git a/builtin/commit.c b/builtin/commit.c\n> index 1d805f5da..0f36d2ac3 100644\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -1648,6 +1648,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n>  \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n>\n>  \tstatus_init_config(&s, git_commit_config);\n> +\ts.commit_template = 1;\n>  \tstatus_format = STATUS_FORMAT_NONE; /* Ignore status.short */\n>  \ts.colopts = 0;\n>\n> diff --git a/wt-status.c b/wt-status.c\n> index 037548496..34aa1af66 100644\n> --- a/wt-status.c\n> +++ b/wt-status.c\n> @@ -1576,7 +1576,10 @@ static void wt_longstatus_print(struct wt_status *s)\n>\n>  \tif (s->is_initial) {\n>  \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n> -\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n> +\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n> +\t\t\t\t s->commit_template\n> +\t\t\t\t ? _(\"Initial commit\")\n> +\t\t\t\t : _(\"No commits yet on the branch\"));\n\nWhy not simply \"No commits yet\", saying \"on the branch\" is needlessy\nduplicating information in the context of the status output in which\nthis is printed, i.e. now you have:\n\n    $ ~/g/git/git-status\n    On branch master\n\n    No commits yet on the branch\n\n    nothing to commit (create/copy files and use \"git add\" to track)\n\nBut we can just more succinctly say:\n\n    $ ~/g/git/git-status\n    On branch master\n\n    No commits yet\n\n    nothing to commit (create/copy files and use \"git add\" to track)\n\nSince we've already pointed out that the user is on a branch.\n\nAlso, if something is worth fixing it's worth testing for, so you can\nfix this test into the patch:\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 79427840a4..b9532d201d 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1608,4 +1608,15 @@ test_expect_success 'git commit -m will commit a staged but ignored submodule' '\n        git config -f .gitmodules  --remove-section submodule.subname\n '\n \n+test_expect_success 'No commits yet should be noted in status output' '\n+       git init initial &&\n+       cd initial &&\n+       git status >output &&\n+       test_i18ngrep \"No commits yet\" output &&\n+       test_commit initial &&\n+       git status >output &&\n+       test_i18ngrep ! \"No commits yet\" output &&\n+       test_i18ngrep \"nothing.*to commit\" output\n+'\n+\n test_done\ndiff --git a/wt-status.c b/wt-status.c\nindex 7991fd1098..f324ea20a6 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1582,7 +1582,7 @@ static void wt_longstatus_print(struct wt_status *s)\n                status_printf_ln(s, color(WT_STATUS_HEADER, s),\n                                 s->commit_template\n                                 ? _(\"Initial commit\")\n-                                : _(\"No commits yet on the branch\"));\n+                                : _(\"No commits yet\"));\n                status_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n        }\n\n\n>  \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n>  \t}\n>\n> diff --git a/wt-status.h b/wt-status.h\n> index 6018c627b..782b2997f 100644\n> --- a/wt-status.h\n> +++ b/wt-status.h\n> @@ -76,6 +76,7 @@ struct wt_status {\n>  \tchar color_palette[WT_STATUS_MAXSLOT][COLOR_MAXLEN];\n>  \tunsigned colopts;\n>  \tint null_termination;\n> +\tint commit_template;\n>  \tint show_branch;\n>  \tint hints;\n"},{"id":"322538","messageId":"20170619024123.5438-1-kaarticsivaraam91196@gmail.com","threadId":"46151","inReplyTo":"87shix8zik.fsf@gmail.com","subject":"[PATCH 1/2] Contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-19T02:41:23Z","receivedAt":"2017-06-19T02:41:51Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"\"git status\" indicated \"Initial commit\" when HEAD points at\nan unborn branch.  This message is shared with the commit\nlog template \"git commit\" prepares for the user when\ncreating a commit (i.e. \"You are about to create the initial\ncommit\"), and is OK as long as the reader is aware of the\nnature of the message (i.e. it guides the user working\ntoward the next commit), but was confusing to new users,\nespecially the ones who do \"git commit -m message\" without\nhaving a chance to pay attention to the commit log template.\n\nThe \"Initial commit\" indication wasn't an issue in the commit\ntemplate. Taking that into consideration, a good solution would\nbe to contextually use different messages to indicate the user\nthat there were no commits in this branch.\n\nA few alternatives considered were,\n\n* Waiting for initial commit\n* Your current branch does not have any commits\n* Current branch waiting for initial commit\n\nPatch-derived-from: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n  Hope this would be final :)\n\n builtin/commit.c | 1 +\n wt-status.c      | 5 ++++-\n wt-status.h      | 1 +\n 3 files changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 1d805f5da..0f36d2ac3 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1648,6 +1648,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n \n \tstatus_init_config(&s, git_commit_config);\n+\ts.commit_template = 1;\n \tstatus_format = STATUS_FORMAT_NONE; /* Ignore status.short */\n \ts.colopts = 0;\n \ndiff --git a/wt-status.c b/wt-status.c\nindex 037548496..e6a9ee34f 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1576,7 +1576,10 @@ static void wt_longstatus_print(struct wt_status *s)\n \n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n+\t\t\t\t s->commit_template\n+\t\t\t\t ? _(\"Initial commit\")\n+\t\t\t\t : _(\"No commits yet\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n \t}\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 6018c627b..782b2997f 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -76,6 +76,7 @@ struct wt_status {\n \tchar color_palette[WT_STATUS_MAXSLOT][COLOR_MAXLEN];\n \tunsigned colopts;\n \tint null_termination;\n+\tint commit_template;\n \tint show_branch;\n \tint hints;\n \n-- \n2.11.0\n\n"},{"id":"322539","messageId":"20170619024144.5537-1-kaarticsivaraam91196@gmail.com","threadId":"46151","inReplyTo":"87shix8zik.fsf@gmail.com","subject":"[PATCH 2/2] Add test for the new status message","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-19T02:41:44Z","receivedAt":"2017-06-19T02:42:19Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Patch-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n t/t7508-status.sh | 11 +++++++++++\n 1 file changed, 11 insertions(+)\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex fb00e6d9b..e9337c728 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1499,4 +1499,15 @@ test_expect_success 'git commit -m will commit a staged but ignored submodule' '\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n+test_expect_success 'No commits yet should be noted in status output' '\n+       git init initial &&\n+       cd initial &&\n+       git status >output &&\n+       test_i18ngrep \"No commits yet\" output &&\n+       test_commit initial &&\n+       git status >output &&\n+       test_i18ngrep ! \"No commits yet\" output &&\n+       test_i18ngrep \"nothing.*to commit\" output\n+'\n+\n test_done\n-- \n2.11.0\n\n"},{"id":"322540","messageId":"20170619024412.5861-1-kaarticsivaraam91196@gmail.com","threadId":"46151","inReplyTo":"20170619024123.5438-1-kaarticsivaraam91196@gmail.com","subject":"[PATCH 2/2] Add test for the new status message","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-19T02:44:12Z","receivedAt":"2017-06-19T02:44:43Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Patch-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n\nResending as a continuation of previous patch\n\n t/t7508-status.sh | 11 +++++++++++\n 1 file changed, 11 insertions(+)\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex fb00e6d9b..e9337c728 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1499,4 +1499,15 @@ test_expect_success 'git commit -m will commit a staged but ignored submodule' '\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n+test_expect_success 'No commits yet should be noted in status output' '\n+       git init initial &&\n+       cd initial &&\n+       git status >output &&\n+       test_i18ngrep \"No commits yet\" output &&\n+       test_commit initial &&\n+       git status >output &&\n+       test_i18ngrep ! \"No commits yet\" output &&\n+       test_i18ngrep \"nothing.*to commit\" output\n+'\n+\n test_done\n-- \n2.11.0\n\n"},{"id":"322544","messageId":"xmqqlgoovbvm.fsf@gitster.mtv.corp.google.com","threadId":"46151","inReplyTo":"20170619024123.5438-1-kaarticsivaraam91196@gmail.com","subject":"Re: [PATCH 1/2] Contextually notify user about an initial commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-19T04:29:17Z","receivedAt":"2017-06-19T04:29:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:\n\n> A few alternatives considered were,\n>\n> * Waiting for initial commit\n> * Your current branch does not have any commits\n> * Current branch waiting for initial commit\n>\n\n... \"Decided to take the most succinct one.\" or something to\nconclude what happend to these alternatives would be nice to spell\nout as a conclusion here.\n\n> Patch-derived-from: Junio C Hamano <gitster@pobox.com>\n\nThat's just \"Helped-by:\".\n\n> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n> ---\n>   Hope this would be final :)\n>\n>  builtin/commit.c | 1 +\n>  wt-status.c      | 5 ++++-\n>  wt-status.h      | 1 +\n>  3 files changed, 6 insertions(+), 1 deletion(-)\n\n\nThanks.  \nHave you run the full test suite after applying this patch?\n\nAdjustment to existing tests to update their expectation would be a\ngood thing to have in this patch that would easily illustaret what\nwill change and how.\n\nAt least this would be needed; there may be other breakages.\n\n\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 0b6da7ae1f..fa61b1a4ee 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -18,7 +18,7 @@ test_expect_success 'initial status' '\n \techo bongo bongo >file &&\n \tgit add file &&\n \tgit status >actual &&\n-\ttest_i18ngrep \"Initial commit\" actual\n+\ttest_i18ngrep \"No commits yet\" actual\n '\n \n test_expect_success 'fail initial amend' '\n"},{"id":"322545","messageId":"xmqqh8zcvbq8.fsf@gitster.mtv.corp.google.com","threadId":"46151","inReplyTo":"20170619024412.5861-1-kaarticsivaraam91196@gmail.com","subject":"Re: [PATCH 2/2] Add test for the new status message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-19T04:32:31Z","receivedAt":"2017-06-19T04:32:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:\n\n> +test_expect_success 'No commits yet should be noted in status output' '\n> +       git init initial &&\n> +       cd initial &&\n> +       git status >output &&\n> +       test_i18ngrep \"No commits yet\" output &&\n> +       test_commit initial &&\n> +       git status >output &&\n> +       test_i18ngrep ! \"No commits yet\" output &&\n> +       test_i18ngrep \"nothing.*to commit\" output\n> +'\n> +\n\nDo not \"cd\" in a test, without being in a subshell.  When other\npeople in the future want to add new tests to the end of this\nscript, the new test will end up running in the new subdirectory,\nwhich is not something they should have to worry about.\n\n\tgit checkout --orphan empty-branch &&\n\tgit status >output &&\n\ttest_i18ngrep \"No commits yet\" output &&\n\t...\n\nperhaps?\n\n\n>  test_done\n"},{"id":"322551","messageId":"20170619091050.kymih3f345kexaf7@sigill.intra.peff.net","threadId":"46151","inReplyTo":"87shix8zik.fsf@gmail.com","subject":"Re: [PATCH/ALMOST FINAL] Contextually notify user about an initial commit","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-19T09:10:51Z","receivedAt":"2017-06-19T09:11:07Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jun 18, 2017 at 10:34:59AM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> Why not simply \"No commits yet\", saying \"on the branch\" is needlessy\n> duplicating information in the context of the status output in which\n> this is printed, i.e. now you have:\n> \n>     $ ~/g/git/git-status\n>     On branch master\n> \n>     No commits yet on the branch\n> \n>     nothing to commit (create/copy files and use \"git add\" to track)\n> \n> But we can just more succinctly say:\n> \n>     $ ~/g/git/git-status\n>     On branch master\n> \n>     No commits yet\n> \n>     nothing to commit (create/copy files and use \"git add\" to track)\n> \n> Since we've already pointed out that the user is on a branch.\n\nI thought one of the points was to disambiguate the case of \"no commits\nyet in the repository\" and \"no commits yet on the branch\". If we don't\ncare about making that distinction (or think that the mention of the\nbranch is enough to make it clear), then succinct is fine. I don't have\na strong opinion either way.\n\n-Peff\n"},{"id":"322563","messageId":"1497878658.1909.3.camel@gmail.com","threadId":"46151","inReplyTo":"20170619091050.kymih3f345kexaf7@sigill.intra.peff.net","subject":"Re: [PATCH/ALMOST FINAL] Contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-19T13:24:18Z","receivedAt":"2017-06-19T13:25:04Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Mon, 2017-06-19 at 05:10 -0400, Jeff King wrote:\n> On Sun, Jun 18, 2017 at 10:34:59AM +0200, Ævar Arnfjörð Bjarmason\n> wrote:\n> \n> > Why not simply \"No commits yet\", saying \"on the branch\" is\n> > needlessy\n> > duplicating information in the context of the status output in\n> > which\n> > this is printed, i.e. now you have:\n> > \n> >     $ ~/g/git/git-status\n> >     On branch master\n> > \n> >     No commits yet on the branch\n> > \n> >     nothing to commit (create/copy files and use \"git add\" to\n> > track)\n> > Since we've already pointed out that the user is on a branch.\n> \n> I thought one of the points was to disambiguate the case of \"no\n> commits\n> yet in the repository\" and \"no commits yet on the branch\". If we\n> don't\n> care about making that distinction (or think that the mention of the\n> branch is enough to make it clear), then succinct is fine. I don't\n> have\n> a strong opinion either way.\n> \nI had the same thought in the beginning but the sample output seemed to\nmake me think \"The terse message was fine\". I am unopinionated, too.\nI'll stay with \"No commits yet\" for now until someone suggests to\nchange it due to confusion about whether it's a \"No commits yet on the\nbranch\" or it's a \"No commits yet on this repository\".\n\n--\nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n"},{"id":"322567","messageId":"xmqqshiwt1w6.fsf@gitster.mtv.corp.google.com","threadId":"46151","inReplyTo":"20170619091050.kymih3f345kexaf7@sigill.intra.peff.net","subject":"Re: [PATCH/ALMOST FINAL] Contextually notify user about an initial commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-19T15:47:53Z","receivedAt":"2017-06-19T15:48:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sun, Jun 18, 2017 at 10:34:59AM +0200, Ævar Arnfjörð Bjarmason wrote:\n>\n>> Why not simply \"No commits yet\", saying \"on the branch\" is needlessy\n>> duplicating information in the context of the status output in which\n>> this is printed, i.e. now you have:\n>> \n>>     $ ~/g/git/git-status\n>>     On branch master\n>> \n>>     No commits yet on the branch\n>> \n>>     nothing to commit (create/copy files and use \"git add\" to track)\n>> \n>> But we can just more succinctly say:\n>> \n>>     $ ~/g/git/git-status\n>>     On branch master\n>> \n>>     No commits yet\n>> \n>>     nothing to commit (create/copy files and use \"git add\" to track)\n>> \n>> Since we've already pointed out that the user is on a branch.\n>\n> I thought one of the points was to disambiguate the case of \"no commits\n> yet in the repository\" and \"no commits yet on the branch\". If we don't\n> care about making that distinction (or think that the mention of the\n> branch is enough to make it clear), then succinct is fine. I don't have\n> a strong opinion either way.\n\nNeither do I.  As long as we always say \"On branch X\", the end\nresult would not make much difference with or without \"on the\nbranch\" at the end of this line, I would think.\n\nThanks.\n"},{"id":"322592","messageId":"1497895189.18850.9.camel@gmail.com","threadId":"46151","inReplyTo":"xmqqh8zcvbq8.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/2] Add test for the new status message","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-19T17:59:49Z","receivedAt":"2017-06-19T18:00:08Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Sun, 2017-06-18 at 21:32 -0700, Junio C Hamano wrote:\n> Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:\n> \n> > +test_expect_success 'No commits yet should be noted in status\n> > output' '\n> > +       git init initial &&\n> > +       cd initial &&\n> > +       git status >output &&\n> > +       test_i18ngrep \"No commits yet\" output &&\n> > +       test_commit initial &&\n> > +       git status >output &&\n> > +       test_i18ngrep ! \"No commits yet\" output &&\n> > +       test_i18ngrep \"nothing.*to commit\" output\n> > +'\n> > +\n> \n> Do not \"cd\" in a test, without being in a subshell.  When other\n> people in the future want to add new tests to the end of this\n> script, the new test will end up running in the new subdirectory,\n> which is not something they should have to worry about.\n> \n> \tgit checkout --orphan empty-branch &&\n> \tgit status >output &&\n> \ttest_i18ngrep \"No commits yet\" output &&\n> \t...\n> \n> perhaps?\n> \n> \n>  test_done\nFixed it. I wasn't aware of the guide lines for writing tests when I\nused the patch from the thread blindly. I'll be careful to avoid that\nin future.\n\nIs there a way to test for the \"Initial commit\" message in the commit\ntemplate?\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n"},{"id":"322593","messageId":"20170619180450.tjldpkltdwqad4ic@sigill.intra.peff.net","threadId":"46151","inReplyTo":"1497895189.18850.9.camel@gmail.com","subject":"Re: [PATCH 2/2] Add test for the new status message","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-19T18:04:50Z","receivedAt":"2017-06-19T18:04:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 19, 2017 at 11:29:49PM +0530, Kaartic Sivaraam wrote:\n\n> Is there a way to test for the \"Initial commit\" message in the commit\n> template?\n\nYou can do \"git commit --dry-run\", which produces the template on\nstdout.\n\nThat should be good enough for our purposes here, as it's the same code\nthat produces the text that goes into the editor template. If you really\nwanted to test what the editor sees, you could do something like:\n\n  GIT_EDITOR='cat >editor-input' git commit\n\nbut I don't think it's worth the trouble.\n\n-Peff\n"},{"id":"322602","messageId":"1497897210.18850.11.camel@gmail.com","threadId":"46151","inReplyTo":"20170619180450.tjldpkltdwqad4ic@sigill.intra.peff.net","subject":"Re: [PATCH 2/2] Add test for the new status message","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-19T18:33:30Z","receivedAt":"2017-06-19T19:44:23Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"\nOn Mon, 2017-06-19 at 14:04 -0400, Jeff King wrote:\n> On Mon, Jun 19, 2017 at 11:29:49PM +0530, Kaartic Sivaraam wrote:\n> \n> > Is there a way to test for the \"Initial commit\" message in the\n> > commit\n> > template?\n> \n> You can do \"git commit --dry-run\", which produces the template on\n> stdout.\nThanks for the help :)\n\n> \n> That should be good enough for our purposes here, as it's the same\n> code\n> that produces the text that goes into the editor template. If you\n> really\n> wanted to test what the editor sees, you could do something like:\n> \n>   GIT_EDITOR='cat >editor-input' git commit\n> \n> but I don't think it's worth the trouble.\n> \nThat's right. I thinks it's not worth the trouble too.\n\n"},{"id":"322671","messageId":"20170620030220.7323-1-kaarticsivaraam91196@gmail.com","threadId":"46151","inReplyTo":"xmqqshiwt1w6.fsf@gitster.mtv.corp.google.com","subject":"[PATCH 1/3] Contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-20T03:02:18Z","receivedAt":"2017-06-20T03:03:00Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"\"git status\" indicated \"Initial commit\" when HEAD points at\nan unborn branch.  This message is shared with the commit\nlog template \"git commit\" prepares for the user when\ncreating a commit (i.e. \"You are about to create the initial\ncommit\"), and is OK as long as the reader is aware of the\nnature of the message (i.e. it guides the user working\ntoward the next commit), but was confusing to new users,\nespecially the ones who do \"git commit -m message\" without\nhaving a chance to pay attention to the commit log template.\n\nThe \"Initial commit\" indication wasn't an issue in the commit\ntemplate. Taking that into consideration, a good solution would\nbe to contextually use different messages to indicate the user\nthat there were no commits in this branch.\n\nA few alternatives considered were,\n\n* Waiting for initial commit\n* Your current branch does not have any commits\n* Current branch waiting for initial commit\n\nThe most succint one, \"No commits yet\", among the alternatives\nwas chosen.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n builtin/commit.c | 1 +\n wt-status.c      | 5 ++++-\n wt-status.h      | 1 +\n 3 files changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 1d805f5da..0f36d2ac3 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1648,6 +1648,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n \n \tstatus_init_config(&s, git_commit_config);\n+\ts.commit_template = 1;\n \tstatus_format = STATUS_FORMAT_NONE; /* Ignore status.short */\n \ts.colopts = 0;\n \ndiff --git a/wt-status.c b/wt-status.c\nindex 037548496..e6a9ee34f 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1576,7 +1576,10 @@ static void wt_longstatus_print(struct wt_status *s)\n \n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n+\t\t\t\t s->commit_template\n+\t\t\t\t ? _(\"Initial commit\")\n+\t\t\t\t : _(\"No commits yet\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n \t}\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 6018c627b..782b2997f 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -76,6 +76,7 @@ struct wt_status {\n \tchar color_palette[WT_STATUS_MAXSLOT][COLOR_MAXLEN];\n \tunsigned colopts;\n \tint null_termination;\n+\tint commit_template;\n \tint show_branch;\n \tint hints;\n \n-- \n2.11.0\n\n"},{"id":"322672","messageId":"20170620030220.7323-2-kaarticsivaraam91196@gmail.com","threadId":"46151","inReplyTo":"20170620030220.7323-1-kaarticsivaraam91196@gmail.com","subject":"[PATCH 2/3] Update test(s) that used old status message","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-20T03:02:19Z","receivedAt":"2017-06-20T03:03:18Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"The tests that checked for old status message have been\nupdated to check for the new status message\n\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n t/t7501-commit.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 0b6da7ae1..fa61b1a4e 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -18,7 +18,7 @@ test_expect_success 'initial status' '\n \techo bongo bongo >file &&\n \tgit add file &&\n \tgit status >actual &&\n-\ttest_i18ngrep \"Initial commit\" actual\n+\ttest_i18ngrep \"No commits yet\" actual\n '\n \n test_expect_success 'fail initial amend' '\n-- \n2.11.0\n\n"},{"id":"322673","messageId":"20170620030220.7323-3-kaarticsivaraam91196@gmail.com","threadId":"46151","inReplyTo":"20170620030220.7323-1-kaarticsivaraam91196@gmail.com","subject":"[PATCH 3/3] Add tests for the contextual initial status message","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-20T03:02:20Z","receivedAt":"2017-06-20T03:03:44Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Also, fixed minor spacing issue\n\nHelped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n t/t7508-status.sh | 32 +++++++++++++++++++++++++++++++-\n 1 file changed, 31 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex fb00e6d9b..6cf3af9d9 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1494,9 +1494,39 @@ EOF\n test_expect_success 'git commit -m will commit a staged but ignored submodule' '\n \tgit commit -uno -m message &&\n \tgit status -s --ignore-submodules=dirty >output &&\n-\t test_i18ngrep ! \"^M. sm\" output &&\n+\ttest_i18ngrep ! \"^M. sm\" output &&\n \tgit config --remove-section submodule.subname &&\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n+test_expect_success '\"No commits yet\" should be noted in status output' '\n+\tgit checkout --orphan empty-branch-1 &&\n+\tgit status >output &&\n+\ttest_i18ngrep \"No commits yet\" output\n+'\n+\n+test_expect_success '\"No commits yet\" should not be noted in status output' '\n+\tgit checkout --orphan empty-branch-2 &&\n+\ttest_commit test-commit-1 &&\n+\tgit status >output &&\n+\ttest_i18ngrep ! \"No commits yet\" output\n+'\n+\n+test_expect_success '\"Initial commit\" should be noted in commit template' '\n+\tgit checkout --orphan empty-branch-3 &&\n+\ttouch to_be_committed_1 &&\n+\tgit add to_be_committed_1 &&\n+\tgit commit --dry-run >output &&\n+\ttest_i18ngrep \"Initial commit\" output\n+'\n+\n+test_expect_success '\"Initial commit\" should not be noted in commit template' '\n+\tgit checkout --orphan empty-branch-4 &&\n+\ttest_commit test-commit-2 &&\n+\ttouch to_be_committed_2 &&\n+\tgit add to_be_committed_2 &&\n+\tgit commit --dry-run >output &&\n+\ttest_i18ngrep ! \"Initial commit\" output\n+'\n+\n test_done\n-- \n2.11.0\n\n"},{"id":"322676","messageId":"87o9tj86hs.fsf@gmail.com","threadId":"46151","inReplyTo":"20170620030220.7323-1-kaarticsivaraam91196@gmail.com","subject":"Re: [PATCH 1/3] Contextually notify user about an initial commit","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-20T07:26:23Z","receivedAt":"2017-06-20T07:26:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Jun 20 2017, Kaartic Sivaraam jotted:\n\n> \"git status\" indicated \"Initial commit\" when HEAD points at\n> an unborn branch.  This message is shared with the commit\n> log template \"git commit\" prepares for the user when\n> creating a commit (i.e. \"You are about to create the initial\n> commit\"), and is OK as long as the reader is aware of the\n> nature of the message (i.e. it guides the user working\n> toward the next commit), but was confusing to new users,\n> especially the ones who do \"git commit -m message\" without\n> having a chance to pay attention to the commit log template.\n>\n> The \"Initial commit\" indication wasn't an issue in the commit\n> template. Taking that into consideration, a good solution would\n> be to contextually use different messages to indicate the user\n> that there were no commits in this branch.\n>\n> A few alternatives considered were,\n>\n> * Waiting for initial commit\n> * Your current branch does not have any commits\n> * Current branch waiting for initial commit\n>\n> The most succint one, \"No commits yet\", among the alternatives\n> was chosen.\n>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n\nThere's a few issues with these 3 patches I think should be fixed:\n\n * Let's do that spacing fix (unrelated fix) in its own commit.\n\n * You should add tests along with the code being changed, and\n   especially change tests that would fail with your new code, otherwise\n   you break bisection.\n\n * I think the commit message here could be shorter & clearer at the\n   same time.\n\n * The commit message doesn't follow our usual format.\n\nOther than that this looks good to me.\n\nI've pushed a fixed version with those fixes to\nhelp-kaartic-with-no-commits-yet on github.com/avar/git\n(https://github.com/avar/git/tree/help-kaartic-with-no-commits-yet). You\ncould just submit that as a v2 pending any comments others might have.\n\nThat yields a 2 patch series, here pasted below for on-list review:\n\ncommit 23d792d8d3\nAuthor: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\nDate:   Tue Jun 20 08:32:20 2017 +0530\n\n    status tests: fix a minor indenting issue\n\n    Change the indentation from \"\\t \" to \"\\t\". This indenting issue was\n    introduced when the test was added in commit\n    1d2f393ac9 (\"status/commit: show staged submodules regardless of\n    ignore config\", 2014-04-05).\n\n    Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n    Helped-by: Junio C Hamano <gitster@pobox.com>\n    Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 79427840a4..ebad377d68 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1603,7 +1603,7 @@ EOF\n test_expect_success 'git commit -m will commit a staged but ignored submodule' '\n \tgit commit -uno -m message &&\n \tgit status -s --ignore-submodules=dirty >output &&\n-\t test_i18ngrep ! \"^M. sm\" output &&\n+\ttest_i18ngrep ! \"^M. sm\" output &&\n \tgit config --remove-section submodule.subname &&\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n\ncommit d2eed0491c (HEAD -> help-kaartic-with-no-commits-yet, avar/help-kaartic-with-no-commits-yet)\nAuthor: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\nDate:   Tue Jun 20 08:32:18 2017 +0530\n\n    status: contextually notify user about an initial commit\n\n    Change the output of \"status\" to say \"No commits yet\" when \"git\n    status\" is run on a fresh repo (or orphan branch), while retaining the\n    current \"Initial commit\" message displayed in the template that's\n    displayed in the editor when the initial commit is being authored.\n\n    The existing \"Initial commit\" message makes sense for the commit\n    template where we're making the initial commit, but is confusing when\n    merely checking the status of a fresh repository without having any\n    commits yet.\n\n    Helped-by: Junio C Hamano <gitster@pobox.com>\n    Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex e3c9e190b0..8d075c15a3 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1652,6 +1652,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n\n \tstatus_init_config(&s, git_commit_config);\n+\ts.commit_template = 1;\n \tstatus_format = STATUS_FORMAT_NONE; /* Ignore status.short */\n \ts.colopts = 0;\n\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 0b6da7ae1f..fa61b1a4ee 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -18,7 +18,7 @@ test_expect_success 'initial status' '\n \techo bongo bongo >file &&\n \tgit add file &&\n \tgit status >actual &&\n-\ttest_i18ngrep \"Initial commit\" actual\n+\ttest_i18ngrep \"No commits yet\" actual\n '\n\n test_expect_success 'fail initial amend' '\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex ebad377d68..57a37f88a4 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1608,4 +1608,34 @@ test_expect_success 'git commit -m will commit a staged but ignored submodule' '\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n\n+test_expect_success '\"No commits yet\" should be noted in status output' '\n+\tgit checkout --orphan empty-branch-1 &&\n+\tgit status >output &&\n+\ttest_i18ngrep \"No commits yet\" output\n+'\n+\n+test_expect_success '\"No commits yet\" should not be noted in status output' '\n+\tgit checkout --orphan empty-branch-2 &&\n+\ttest_commit test-commit-1 &&\n+\tgit status >output &&\n+\ttest_i18ngrep ! \"No commits yet\" output\n+'\n+\n+test_expect_success '\"Initial commit\" should be noted in commit template' '\n+\tgit checkout --orphan empty-branch-3 &&\n+\ttouch to_be_committed_1 &&\n+\tgit add to_be_committed_1 &&\n+\tgit commit --dry-run >output &&\n+\ttest_i18ngrep \"Initial commit\" output\n+'\n+\n+test_expect_success '\"Initial commit\" should not be noted in commit template' '\n+\tgit checkout --orphan empty-branch-4 &&\n+\ttest_commit test-commit-2 &&\n+\ttouch to_be_committed_2 &&\n+\tgit add to_be_committed_2 &&\n+\tgit commit --dry-run >output &&\n+\ttest_i18ngrep ! \"Initial commit\" output\n+'\n+\n test_done\ndiff --git a/wt-status.c b/wt-status.c\nindex bf651f16fa..f324ea20a6 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1579,7 +1579,10 @@ static void wt_longstatus_print(struct wt_status *s)\n\n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n+\t\t\t\t s->commit_template\n+\t\t\t\t ? _(\"Initial commit\")\n+\t\t\t\t : _(\"No commits yet\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n \t}\n\ndiff --git a/wt-status.h b/wt-status.h\nindex 8a3864783b..2389f08390 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -76,6 +76,7 @@ struct wt_status {\n \tchar color_palette[WT_STATUS_MAXSLOT][COLOR_MAXLEN];\n \tunsigned colopts;\n \tint null_termination;\n+\tint commit_template;\n \tint show_branch;\n \tint hints;\n"},{"id":"322733","messageId":"1497965839.2792.2.camel@gmail.com","threadId":"46151","inReplyTo":"87o9tj86hs.fsf@gmail.com","subject":"Re: [PATCH 1/3] Contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-20T13:37:19Z","receivedAt":"2017-06-20T13:37:40Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Thanks for trying to help. A few comments regarding your suggestions.\n\n>  * Let's do that spacing fix (unrelated fix) in its own commit.\n> \nOk. That's a good point.\n\n>   * You should add tests along with the code being changed, and\n>     especially change tests that would fail with your new code,\n>     otherwise you break bisection.\n> \nI'm not sure if the convention here is to keep tests along with change\nit tests. I thought it would be better to separate them as they are\n\"separate\" changes. They're separate because in case of any issues with\nthe test it should be possible to identify them separately. This isn't\npossible when they are added along with the change. \n\nFurther, adding them as a separate change change (commit) immediately\nafter the change it tests would ease the task of finding the change it\ntests.\n\nIf the convention here, really, is to add tests along with the\nchange, I can't do anything but to follow it. I guess it should be\nmentioned somewhere in the Documentation/SubmittingPatches. AFAIK, I\ndon't think it's mentioned there.\n\n>  * I think the commit message here could be shorter & clearer at the\n>    same time.\nI don't think it's unclear. It's longer for the reason that follows.\nThe commit message was crafted based on the following guideline found\nin Documentation/SubmittingPatches\n\n> The body should provide a meaningful commit message, which:\n> \n>   . explains the problem the change tries to solve, i.e. what is \n>     wrong with the current code without the change.\n> \n>   . justifies the way the change solves the problem, i.e. why the\n>     result with the change is better.\n> \n>   . alternate solutions considered but discarded, if any.\n> \nI don't think the new commit message follows this. Both the commit\nmessages are found below for comparison.\n\nOld one\n-------\n> On Tue, Jun 20 2017, Kaartic Sivaraam jotted:\n> \n>  \"git status\" indicated \"Initial commit\" when HEAD points at\n>  an unborn branch.  This message is shared with the commit\n>  log template \"git commit\" prepares for the user when\n>  creating a commit (i.e. \"You are about to create the initial\n>  commit\"), and is OK as long as the reader is aware of the\n>  nature of the message (i.e. it guides the user working\n>  toward the next commit), but was confusing to new users,\n>  especially the ones who do \"git commit -m message\" without\n>  having a chance to pay attention to the commit log template.\n>  \n>  The \"Initial commit\" indication wasn't an issue in the commit\n>  template. Taking that into consideration, a good solution would\n>  be to contextually use different messages to indicate the user\n>  that there were no commits in this branch.\n> \n>  A few alternatives considered were,\n>  \n>  * Waiting for initial commit\n>  * Your current branch does not have any commits\n>  * Current branch waiting for initial commit\n>  \n>  The most succint one, \"No commits yet\", among the alternatives\n>  was chosen.\n>  \n>  Helped-by: Junio C Hamano <gitster@pobox.com>\n>  Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n> \n\nNew one\n-------\n>  status: contextually notify user about an initial commit\n> \n>  Change the output of \"status\" to say \"No commits yet\" when \"git\n>  retaining the current \"Initial commit\" message displayed in the\n>  template that's displayed in the editor when the initial commit is\n>  being authored.\n> \n>  The existing \"Initial commit\" message makes sense for the commit\n>  template where we're making the initial commit, but is confusing \n>  when merely checking the status of a fresh repository without \n>  having any commits yet.\n> \n>  Helped-by: Junio C Hamano <gitster@pobox.com>\n>  Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n>  Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>  \n\n>  * The commit message doesn't follow our usual format.\nCould you be more specific about where it's not following the format?\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n"},{"id":"322737","messageId":"87mv9290wl.fsf@gmail.com","threadId":"46151","inReplyTo":"1497965839.2792.2.camel@gmail.com","subject":"Re: [PATCH 1/3] Contextually notify user about an initial commit","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-20T14:41:46Z","receivedAt":"2017-06-20T14:41:58Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Jun 20 2017, Kaartic Sivaraam jotted:\n\n> Thanks for trying to help. A few comments regarding your suggestions.\n>\n>> * Let's do that spacing fix (unrelated fix) in its own commit.\n>>\n> Ok. That's a good point.\n>\n>> * You should add tests along with the code being changed, and\n>> especially change tests that would fail with your new code,\n>>     otherwise you break bisection.\n>>\n> I'm not sure if the convention here is to keep tests along with change\n> it tests. I thought it would be better to separate them as they are\n> \"separate\" changes. They're separate because in case of any issues with\n> the test it should be possible to identify them separately. This isn't\n> possible when they are added along with the change.\n>\n> Further, adding them as a separate change change (commit) immediately\n> after the change it tests would ease the task of finding the change it\n> tests.\n>\n> If the convention here, really, is to add tests along with the\n> change,I can't do anything but to follow it. I guess it should be\n> mentioned somewhere in the Documentation/SubmittingPatches. AFAIK, I\n> don't think it's mentioned there.\n\nRight now 1/3 breaks the test suite. That's a big no-no, any given\ncommit should not break the test suite to not break bisecting.\n\nBut aside from that the general pattern we follow is that if code\nbehavior changes, tests for that new behavior go in the same commit.\n\n>> * I think the commit message here could be shorter & clearer at the\n>> same time.\n> I don't think it's unclear. It's longer for the reason that follows.\n> The commit message was crafted based on the following guideline found\n> in Documentation/SubmittingPatches\n>\n>> The body should provide a meaningful commit message, which:\n>>\n>>  . explains the problem the change tries to solve, i.e. what is\n>>     wrong with the current code without the change.\n>>\n>>  . justifies the way the change solves the problem, i.e. why the\n>> result with the change is better.\n>>\n>>  . alternate solutions considered but discarded, if any.\n>>\n> I don't think the new commit message follows this. Both the commit\n> messages are found below for comparison.\n>\n> Old one\n> -------\n>> On Tue, Jun 20 2017, Kaartic Sivaraam jotted:\n>>\n>>  \"git status\" indicated \"Initial commit\" when HEAD points at\n>>  an unborn branch.This message is shared with the commit\n>>  log template \"git commit\" prepares for the user when\n>>  creating a commit (i.e. \"You are about to create the initial\n>>  commit\"), and is OK as long as the reader is aware of the\n>>  nature of the message (i.e. it guides the user working\n>>  toward the next commit), but was confusing to new users,\n>>  especially the ones who do \"git commit -m message\" without\n>>  having a chance to pay attention to the commit log template.\n>>\n>>  The \"Initial commit\" indication wasn't an issue in the commit\n>>  template. Taking that into consideration, a good solution would\n>>  be to contextually use different messages to indicate the user\n>>  that there were no commits in this branch.\n>>\n>>  A few alternatives considered were,\n>>\n>>  * Waiting for initial commit\n>>  * Your current branch does not have any commits\n>>  * Current branch waiting for initial commit\n>>\n>>  The most succint one, \"No commits yet\", among the alternatives\n>>  was chosen.\n>>\n>>  Helped-by: Junio C Hamano <gitster@pobox.com>\n>>  Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n>>\n>\n> New one\n> -------\n>>  status: contextually notify user about an initial commit\n>>\n>> Change the output of \"status\" to say \"No commits yet\" when \"git\n>>  retaining the current \"Initial commit\" message displayed in the\n>>  template that's displayed in the editor when the initial commit is\n>>  being authored.\n>>\n>> The existing \"Initial commit\" message makes sense for the commit\n>> template where we're making the initial commit, but is confusing\n>>  when merely checking the status of a fresh repository without\n>>  having any commits yet.\n>>\n>> Helped-by: Junio C Hamano <gitster@pobox.com>\n>> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>>\n>\n>> * The commit message doesn't follow our usual format.\n> Could you be more specific about where it's not following the format?\n\nRegarding the format: I was referring to the 'prefix the first line with\n\"area: \"' part of SubmittingPatches, sorry for the brevity. I.e. your\n--oneline output just yields \"Contextually notify user about an initial\ncommit\" but should be \"status: <short summary>\".\n\nFor the rest of the changes I made: I just found the current version\nhard to read, most of the first paragraph is one big 8-line sentence,\nafter reading it over a few times and understanding what it was doing I\nthought I'd rewrite it as a shorter version that was (hopefully) easier\nto understand.\n\nI dropped the \"alternatives considered\" because while it follows the\nSubmittingPatches guidelines as-is, given other patches I've seen what\nwe eventually ended up picking for some trivial wording in a UI message\nis probably better left to a mailing list search for anyone's that\ncurious rather than summarizing all the proposed alternatives in the\ncommit message.\n"},{"id":"322796","messageId":"1498012463.1487.2.camel@gmail.com","threadId":"46151","inReplyTo":"87mv9290wl.fsf@gmail.com","subject":"Re: [PATCH 1/3] Contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-21T02:34:23Z","receivedAt":"2017-06-21T02:34:40Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Tue, 2017-06-20 at 16:41 +0200, Ævar Arnfjörð Bjarmason wrote:\n> Right now 1/3 breaks the test suite. That's a big no-no, any given\n> commit should not break the test suite to not break bisecting.\n> \n> But aside from that the general pattern we follow is that if code\n> behavior changes, tests for that new behavior go in the same commit.\n> \nI did think of squashing the first two patches, anyway. Now the three\nof them (except for that spacing fix) must be squashhed. Not a big\nissue, anyway. I tweaked the suggested commit message a bit for the\nfollowing reason,\n\nEnsure it follows the \"describe problem, justify solution, mention\nalternatives\" pattern as it sounds good and natural. I wanted to keep\nthe alternatives as I found it to the commit message to be a more\nappropriate place than the mailing list archives. This could induce\nothers who see it to do the same ;)\n\n> \n> Regarding the format: I was referring to the 'prefix the first line\n> with\n> \"area: \"' part of SubmittingPatches, sorry for the brevity. I.e. your\n> --oneline output just yields \"Contextually notify user about an\n> initial\n> commit\" but should be \"status: <short summary>\".\n> \nThat's a good one. I initially thought it was optional.\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n"},{"id":"322797","messageId":"20170621023729.3200-1-kaarticsivaraam91196@gmail.com","threadId":"46151","inReplyTo":"1498012463.1487.2.camel@gmail.com","subject":"[PATCH/FINAL] status: contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-21T02:37:29Z","receivedAt":"2017-06-21T02:38:00Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"The existing message, \"Initial commit\", makes sense for the commit template\nnotifying users that it's their initial commit, but is confusing when\nmerely checking the status of a fresh repository (or orphan branch)\nwithout having any commits yet.\n\nChange the output of \"status\" to say \"No commits yet\" when \"git\nstatus\" is run on a fresh repo (or orphan branch), while retaining the\ncurrent \"Initial commit\" message displayed in the template that's\ndisplayed in the editor when the initial commit is being authored.\n\nA few alternatives considered were,\n\n * Waiting for initial commit\n * Your current branch does not have any commits\n * Current branch waiting for initial commit\n\nThe most succint one among the alternatives was chosen.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\n The 'FINAL' part in the subject is just my opinion about \n this patch\n\n builtin/commit.c  |  1 +\n t/t7501-commit.sh |  2 +-\n t/t7508-status.sh | 30 ++++++++++++++++++++++++++++++\n wt-status.c       |  5 ++++-\n wt-status.h       |  1 +\n 5 files changed, 37 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 8d1cac062..3d614a2ac 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1648,6 +1648,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n \n \tstatus_init_config(&s, git_commit_config);\n+\ts.commit_template = 1;\n \tstatus_format = STATUS_FORMAT_NONE; /* Ignore status.short */\n \ts.colopts = 0;\n \ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 0b6da7ae1..fa61b1a4e 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -18,7 +18,7 @@ test_expect_success 'initial status' '\n \techo bongo bongo >file &&\n \tgit add file &&\n \tgit status >actual &&\n-\ttest_i18ngrep \"Initial commit\" actual\n+\ttest_i18ngrep \"No commits yet\" actual\n '\n \n test_expect_success 'fail initial amend' '\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 5edcc6edf..0ffa585e2 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1499,4 +1499,34 @@ test_expect_success 'git commit -m will commit a staged but ignored submodule' '\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n+test_expect_success '\"No commits yet\" should be noted in status output' '\n+\tgit checkout --orphan empty-branch-1 &&\n+\tgit status >output &&\n+\ttest_i18ngrep \"No commits yet\" output\n+'\n+\n+test_expect_success '\"No commits yet\" should not be noted in status output' '\n+\tgit checkout --orphan empty-branch-2 &&\n+\ttest_commit test-commit-1 &&\n+\tgit status >output &&\n+\ttest_must_fail test_i18ngrep \"No commits yet\" output\n+'\n+\n+test_expect_success '\"Initial commit\" should be noted in commit template' '\n+\tgit checkout --orphan empty-branch-3 &&\n+\ttouch to_be_committed_1 &&\n+\tgit add to_be_committed_1 &&\n+\tgit commit --dry-run >output &&\n+\ttest_i18ngrep \"Initial commit\" output\n+'\n+\n+test_expect_success '\"Initial commit\" should not be noted in commit template' '\n+\tgit checkout --orphan empty-branch-4 &&\n+\ttest_commit test-commit-2 &&\n+\ttouch to_be_committed_2 &&\n+\tgit add to_be_committed_2 &&\n+\tgit commit --dry-run >output &&\n+\ttest_must_fail test_i18ngrep \"Initial commit\" output\n+'\n+\n test_done\ndiff --git a/wt-status.c b/wt-status.c\nindex 068de38b5..a2e294bb2 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1578,7 +1578,10 @@ static void wt_longstatus_print(struct wt_status *s)\n \n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n+\t\t\t\t s->commit_template\n+\t\t\t\t ? _(\"Initial commit\")\n+\t\t\t\t : _(\"No commits yet\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n \t}\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 8a3864783..2389f0839 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -76,6 +76,7 @@ struct wt_status {\n \tchar color_palette[WT_STATUS_MAXSLOT][COLOR_MAXLEN];\n \tunsigned colopts;\n \tint null_termination;\n+\tint commit_template;\n \tint show_branch;\n \tint hints;\n \n-- \n2.11.0\n\n"},{"id":"322811","messageId":"1498055714.20886.1.camel@gmail.com","threadId":"46151","inReplyTo":"20170621023729.3200-1-kaarticsivaraam91196@gmail.com","subject":"Re: [PATCH/FINAL] status: contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-21T14:35:14Z","receivedAt":"2017-06-21T14:35:40Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Wed, 2017-06-21 at 08:07 +0530, Kaartic Sivaraam wrote:\n> The existing message, \"Initial commit\", makes sense for the commit\n> template\n> notifying users that it's their initial commit, but is confusing when\n> merely checking the status of a fresh repository (or orphan branch)\n> without having any commits yet.\n> \n> Change the output of \"status\" to say \"No commits yet\" when \"git\n> status\" is run on a fresh repo (or orphan branch), while retaining\n> the\n> current \"Initial commit\" message displayed in the template that's\n> displayed in the editor when the initial commit is being authored.\n> \n> A few alternatives considered were,\n> \n>  * Waiting for initial commit\n>  * Your current branch does not have any commits\n>  * Current branch waiting for initial commit\n> \n> The most succint one among the alternatives was chosen.\n> \n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n> \n>  The 'FINAL' part in the subject is just my opinion about \n>  this patch\n> \nJust for the note, the tests passed locally and all travis-ci builds\njobs succeeded except for the one in which the 'GITTEXT_POISON'\nenvironment variable is enabled. I guess that isn't an issue, from what\nI came to know while digging about it.\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n\n"},{"id":"322812","messageId":"87fuet8kbs.fsf@gmail.com","threadId":"46151","inReplyTo":"1498055714.20886.1.camel@gmail.com","subject":"Re: [PATCH/FINAL] status: contextually notify user about an initial commit","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-06-21T14:52:07Z","receivedAt":"2017-06-21T14:52:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Jun 21 2017, Kaartic Sivaraam jotted:\n\n> On Wed, 2017-06-21 at 08:07 +0530, Kaartic Sivaraam wrote:\n>> The existing message, \"Initial commit\", makes sense for the commit\n>> template\n>> notifying users that it's their initial commit, but is confusing when\n>> merely checking the status of a fresh repository (or orphan branch)\n>> without having any commits yet.\n>>\n>> Change the output of \"status\" to say \"No commits yet\" when \"git\n>> status\" is run on a fresh repo (or orphan branch), while retaining\n>> the\n>> current \"Initial commit\" message displayed in the template that's\n>> displayed in the editor when the initial commit is being authored.\n>>\n>> A few alternatives considered were,\n>>\n>> * Waiting for initial commit\n>> * Your current branch does not have any commits\n>> * Current branch waiting for initial commit\n>>\n>> The most succint one among the alternatives was chosen.\n>>\n>> Helped-by: Junio C Hamano <gitster@pobox.com>\n>> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> ---\n>>\n>> The 'FINAL' part in the subject is just my opinion about\n>> this patch\n>>\n> Just for the note, the tests passed locally and all travis-ci builds\n> jobs succeeded except for the one in which the 'GITTEXT_POISON'\n> environment variable is enabled. I guess that isn't an issue, from what\n> I came to know while digging about it.\n\nNo, this is a bug in your patch, the test suite should pass under\npoison.\n\nThe issue is that you changed the test code I gave you (to also add more\ntests, yay) along the way to do:\n\n    test_must_fail test_i18ngrep ...\n\nInstead of the correct form:\n\n    test_i18ngrep ! ...\n\nThis fixup for your patch makes it work again:\n    \n    diff --git a/t/t7508-status.sh b/t/t7508-status.sh\n    index e0d2c9e581..b3743ff0a8 100755\n    --- a/t/t7508-status.sh\n    +++ b/t/t7508-status.sh\n    @@ -1618,7 +1618,7 @@ test_expect_success '\"No commits yet\" should not be noted in status output' '\n            git checkout --orphan empty-branch-2 &&\n            test_commit test-commit-1 &&\n            git status >output &&\n    -       test_must_fail test_i18ngrep \"No commits yet\" output\n    +       test_i18ngrep ! \"No commits yet\" output\n     '\n     \n     test_expect_success '\"Initial commit\" should be noted in commit template' '\n    @@ -1635,7 +1635,7 @@ test_expect_success '\"Initial commit\" should not be noted in commit template' '\n            touch to_be_committed_2 &&\n            git add to_be_committed_2 &&\n            git commit --dry-run >output &&\n    -       test_must_fail test_i18ngrep \"Initial commit\" output\n    +       test_i18ngrep ! \"Initial commit\" output\n     '\n     \n     test_done\n"},{"id":"322826","messageId":"1498067135.32360.3.camel@gmail.com","threadId":"46151","inReplyTo":"87fuet8kbs.fsf@gmail.com","subject":"Re: [PATCH/FINAL] status: contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-21T17:45:35Z","receivedAt":"2017-06-21T17:45:52Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Wed, 2017-06-21 at 16:52 +0200, Ævar Arnfjörð Bjarmason wrote:\n> No, this is a bug in your patch, the test suite should pass under\n> poison.\n> \n> The issue is that you changed the test code I gave you (to also add\n> more\n> tests, yay) along the way to do:\n> \n>     test_must_fail test_i18ngrep ...\n> \n> Instead of the correct form:\n> \n>     test_i18ngrep ! ...\n> \nYeah, I did it after reading info about 'test_must_fail' in 't/README'.\nI thought it should be used for tests that fail which seemed to be a\nmisinterpretation. Thanks for pointing it out. Fixed it!\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n"},{"id":"322832","messageId":"1498068974.32360.9.camel@gmail.com","threadId":"46151","inReplyTo":"87fuet8kbs.fsf@gmail.com","subject":"[PATCH/FINAL] status: contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-21T18:16:14Z","receivedAt":"2017-06-21T18:16:32Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"The existing message, \"Initial commit\", makes sense for the commit template\nnotifying users that it's their initial commit, but is confusing when\nmerely checking the status of a fresh repository (or orphan branch)\nwithout having any commits yet.\n\nChange the output of \"status\" to say \"No commits yet\" when \"git\nstatus\" is run on a fresh repo (or orphan branch), while retaining the\ncurrent \"Initial commit\" message displayed in the template that's\ndisplayed in the editor when the initial commit is being authored.\n\nCorrespondingly change the output of \"short status\" to \"No commits yet\non \" when \"git status -sb\" is run on a fresh repo (or orphan branch).\n\nA few alternatives considered were,\n\n * Waiting for initial commit\n * Your current branch does not have any commits\n * Current branch waiting for initial commit\n\nThe most succint one among the alternatives was chosen.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Change(s): \n * Added the corresponding change to short status that was\n   missing in the previous patch.\n * Fixed broken tests\n\n\n Note: This is my last attempt to try sending patches using my\n email client in case this one is also line wrapped, please let\n me so that I could avoid sending through my email-client altogether.\n\n I'm trying this because I forgot to turn off line wrapping in my \n email-client while sending previous patches. Hope it works!\n\n builtin/commit.c  |  1 +\n t/t7501-commit.sh |  2 +-\n t/t7508-status.sh | 30 ++++++++++++++++++++++++++++++\n wt-status.c       |  7 +++++--\n wt-status.h       |  1 +\n 5 files changed, 38 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 8d1cac062..3d614a2ac 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1648,6 +1648,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n \n \tstatus_init_config(&s, git_commit_config);\n+\ts.commit_template = 1;\n \tstatus_format = STATUS_FORMAT_NONE; /* Ignore status.short */\n \ts.colopts = 0;\n \ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 0b6da7ae1..fa61b1a4e 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -18,7 +18,7 @@ test_expect_success 'initial status' '\n \techo bongo bongo >file &&\n \tgit add file &&\n \tgit status >actual &&\n-\ttest_i18ngrep \"Initial commit\" actual\n+\ttest_i18ngrep \"No commits yet\" actual\n '\n \n test_expect_success 'fail initial amend' '\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 5edcc6edf..db709048c 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1499,4 +1499,34 @@ test_expect_success 'git commit -m will commit a staged but ignored submodule' '\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n+test_expect_success '\"No commits yet\" should be noted in status output' '\n+\tgit checkout --orphan empty-branch-1 &&\n+\tgit status >output &&\n+\ttest_i18ngrep \"No commits yet\" output\n+'\n+\n+test_expect_success '\"No commits yet\" should not be noted in status output' '\n+\tgit checkout --orphan empty-branch-2 &&\n+\ttest_commit test-commit-1 &&\n+\tgit status >output &&\n+\ttest_i18ngrep ! \"No commits yet\" output\n+'\n+\n+test_expect_success '\"Initial commit\" should be noted in commit template' '\n+\tgit checkout --orphan empty-branch-3 &&\n+\ttouch to_be_committed_1 &&\n+\tgit add to_be_committed_1 &&\n+\tgit commit --dry-run >output &&\n+\ttest_i18ngrep \"Initial commit\" output\n+'\n+\n+test_expect_success '\"Initial commit\" should not be noted in commit template' '\n+\tgit checkout --orphan empty-branch-4 &&\n+\ttest_commit test-commit-2 &&\n+\ttouch to_be_committed_2 &&\n+\tgit add to_be_committed_2 &&\n+\tgit commit --dry-run >output &&\n+\ttest_i18ngrep ! \"Initial commit\" output\n+'\n+\n test_done\ndiff --git a/wt-status.c b/wt-status.c\nindex 068de38b5..c711ef86e 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1578,7 +1578,10 @@ static void wt_longstatus_print(struct wt_status *s)\n \n \tif (s->is_initial) {\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n-\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), _(\"Initial commit\"));\n+\t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s),\n+\t\t\t\t s->commit_template\n+\t\t\t\t ? _(\"Initial commit\")\n+\t\t\t\t : _(\"No commits yet\"));\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"%s\", \"\");\n \t}\n \n@@ -1748,7 +1751,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)\n #define LABEL(string) (s->no_gettext ? (string) : _(string))\n \n \tif (s->is_initial)\n-\t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"Initial commit on \")));\n+\t\tcolor_fprintf(s->fp, header_color, LABEL(N_(\"No commits yet on \")));\n \n \tif (!strcmp(s->branch, \"HEAD\")) {\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_NOBRANCH, s), \"%s\",\ndiff --git a/wt-status.h b/wt-status.h\nindex 8a3864783..2389f0839 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -76,6 +76,7 @@ struct wt_status {\n \tchar color_palette[WT_STATUS_MAXSLOT][COLOR_MAXLEN];\n \tunsigned colopts;\n \tint null_termination;\n+\tint commit_template;\n \tint show_branch;\n \tint hints;\n \n-- \n2.11.0\n"},{"id":"322840","messageId":"xmqqr2ydp4c0.fsf@gitster.mtv.corp.google.com","threadId":"46151","inReplyTo":"1498067135.32360.3.camel@gmail.com","subject":"Re: [PATCH/FINAL] status: contextually notify user about an initial commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-21T18:45:35Z","receivedAt":"2017-06-21T18:45:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:\n\n> On Wed, 2017-06-21 at 16:52 +0200, Ævar Arnfjörð Bjarmason wrote:\n>> No, this is a bug in your patch, the test suite should pass under\n>> poison.\n>> \n>> The issue is that you changed the test code I gave you (to also add\n>> more\n>> tests, yay) along the way to do:\n>> \n>>     test_must_fail test_i18ngrep ...\n>> \n>> Instead of the correct form:\n>> \n>>     test_i18ngrep ! ...\n>> \n> Yeah, I did it after reading info about 'test_must_fail' in 't/README'.\n> I thought it should be used for tests that fail which seemed to be a\n> misinterpretation. Thanks for pointing it out. Fixed it!\n\nActually, test_must_fail _is_ to be used to expect that the command\nbeing tested to fail.  The issue is with i18ngrep, where it is\nrendered to a glorified \"true\" under the poison build.  By writing \n\n    test_must_fail test_i18ngrep ...\n\nyou are saying that you expect test_i18ngrep to fail, but the point\nof i18ngrep is not to fail under the poison build, so...\n\n"},{"id":"322909","messageId":"xmqq1sqcn568.fsf@gitster.mtv.corp.google.com","threadId":"46151","inReplyTo":"1498068974.32360.9.camel@gmail.com","subject":"Re: [PATCH/FINAL] status: contextually notify user about an initial commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-22T02:10:23Z","receivedAt":"2017-06-22T02:10:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:\n\n> The existing message, \"Initial commit\", makes sense for the commit template\n> notifying users that it's their initial commit, but is confusing when\n> merely checking the status of a fresh repository (or orphan branch)\n> without having any commits yet.\n>\n> Change the output of \"status\" to say \"No commits yet\" when \"git\n> status\" is run on a fresh repo (or orphan branch), while retaining the\n> current \"Initial commit\" message displayed in the template that's\n> displayed in the editor when the initial commit is being authored.\n>\n> Correspondingly change the output of \"short status\" to \"No commits yet\n> on \" when \"git status -sb\" is run on a fresh repo (or orphan branch).\n>\n> A few alternatives considered were,\n>\n>  * Waiting for initial commit\n>  * Your current branch does not have any commits\n>  * Current branch waiting for initial commit\n>\n> The most succint one among the alternatives was chosen.\n>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>  Change(s): \n>  * Added the corresponding change to short status that was\n>    missing in the previous patch.\n>  * Fixed broken tests\n>\n>\n>  Note: This is my last attempt to try sending patches using my\n>  email client in case this one is also line wrapped, please let\n>  me so that I could avoid sending through my email-client altogether.\n>\n>  I'm trying this because I forgot to turn off line wrapping in my \n>  email-client while sending previous patches. Hope it works!\n\nYou can check by downloading what you sent out (I showed you how in\nthe other thread).\n\nIt seems that there are funny non-breaking spaces in the additional\ntext below \"---\" but before the diffstat, but they are not part of\npatch text anyway.\n\nYou seem to havespelled \"Ævar\" differently (perhaps difference\nbetween NFD vs NFC ???) which seems to confuse mailinfo, but I don't\nhave time to dig into it myself (it is quicker for me to edit your\nSigned-off-by: while queuing).\n\nAh, wait... it's not like Ævar is relaying your work; it's more like\nsome code / tests were given by him to you to incorporate into this,\nso I suspect that two S-o-b: from you two should be in the reverse\norder.  I'll swap them while queuing.\n\nThanks.\n"},{"id":"322911","messageId":"1498100480.1687.2.camel@gmail.com","threadId":"46151","inReplyTo":"xmqq1sqcn568.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH/FINAL] status: contextually notify user about an initial commit","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-22T03:01:20Z","receivedAt":"2017-06-22T03:01:36Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Wed, 2017-06-21 at 19:10 -0700, Junio C Hamano wrote:\n> You can check by downloading what you sent out (I showed you how in\n> the other thread).\n> \n> It seems that there are funny non-breaking spaces in the additional\n> text below \"---\" but before the diffstat, but they are not part of\n> patch text anyway.\n> \n> You seem to havespelled \"Ævar\" differently (perhaps difference\n> between NFD vs NFC ???) which seems to confuse mailinfo, but I don't\n> have time to dig into it myself (it is quicker for me to edit your\n> Signed-off-by: while queuing).\n> \n> Ah, wait... it's not like Ævar is relaying your work; it's more like\n> some code / tests were given by him to you to incorporate into this,\n> so I suspect that two S-o-b: from you two should be in the reverse\n> order.  I'll swap them while queuing.\n> \n> Thanks.\nSo, from this I conclude the following,\n\n\"Never user e-mail clients to send patches. They seem to be bringing in\nall sorts of surprising changes.\"\n\nThis is just a consequence of not following the advice in\nDocumentation/SubmittingPatches. This won't repeat in future. \n(expecting, I could hold to that statement :))\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n"}]}