{"thread":{"id":"6237","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","startedAt":"2006-12-16T02:53:09Z","lastAt":"2007-01-11T07:17:12Z","messageCount":26,"participants":["Michael Loeffler","Junio C Hamano","Juergen Ruehle","Jeff King","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"296343","messageId":"20061216025309.GA19955@spearce.org","threadId":"6237","inReplyTo":null,"subject":"[PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-16T02:53:09Z","receivedAt":"2006-12-16T02:53:09Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"If a user modifies files and runs 'git commit' (without the very\nuseful -a option) and they have not yet updated the index they\nare probably coming from another SCM-like tool which would perform\nthe same as 'git commit -a' in this case.  Showing the user their\ncurrent status and a final line of \"nothing to commit\" is not very\nreassuring, as the user might believe that Git did not recognize\ntheir files were modified.\n\nInstead we can suggest as part of the 'nothing to commit' message\nthat the user invoke 'git add' to add files to their next commit.\n\nSuggested by Andy Parkins' Git 'niggles' list\n(<200612132237.10051.andyparkins@gmail.com>).\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n git-commit.sh |    2 +-\n wt-status.c   |   11 ++++++-----\n 2 files changed, 7 insertions(+), 6 deletions(-)\n\ndiff --git a/git-commit.sh b/git-commit.sh\nindex 05828bb..2672def 100755\n--- a/git-commit.sh\n+++ b/git-commit.sh\n@@ -515,7 +515,7 @@ then\n \tcurrent=\"$(git-rev-parse --verify HEAD)\"\n else\n \tif [ -z \"$(git-ls-files)\" ]; then\n-\t\techo >&2 Nothing to commit\n+\t\techo >&2 'nothing to commit (use \"git add file1 file2\" to include for commit)'\n \t\texit 1\n \tfi\n \tPARENTS=\"\"\ndiff --git a/wt-status.c b/wt-status.c\nindex 6e9414d..2173d4f 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -15,6 +15,7 @@ static char wt_status_colors[][COLOR_MAXLEN] = {\n \t\"\\033[31m\", /* WT_STATUS_CHANGED: red */\n \t\"\\033[31m\", /* WT_STATUS_UNTRACKED: red */\n };\n+static const char* use_add_msg = \"use \\\"git add file1 file2\\\" to include for commit\";\n \n static int parse_status_slot(const char *var, int offset)\n {\n@@ -162,8 +163,7 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,\n {\n \tint i;\n \tif (q->nr)\n-\t\twt_status_print_header(\"Changed but not updated\",\n-\t\t\t\t\"use git-add on files to include for commit\");\n+\t\twt_status_print_header(\"Changed but not updated\", use_add_msg);\n \tfor (i = 0; i < q->nr; i++)\n \t\twt_status_print_filepair(WT_STATUS_CHANGED, q->queue[i]);\n \tif (q->nr)\n@@ -249,8 +249,7 @@ static void wt_status_print_untracked(const struct wt_status *s)\n \t\t\t\tcontinue;\n \t\t}\n \t\tif (!shown_header) {\n-\t\t\twt_status_print_header(\"Untracked files\",\n-\t\t\t\t\"use \\\"git add\\\" to add to commit\");\n+\t\t\twt_status_print_header(\"Untracked files\", use_add_msg);\n \t\t\tshown_header = 1;\n \t\t}\n \t\tcolor_printf(color(WT_STATUS_HEADER), \"#\\t\");\n@@ -292,7 +291,9 @@ void wt_status_print(struct wt_status *s)\n \tif (s->verbose && !s->is_initial)\n \t\twt_status_print_verbose(s);\n \tif (!s->commitable)\n-\t\tprintf(\"%s\\n\", s->amend ? \"# No changes\" : \"nothing to commit\");\n+\t\tprintf(\"%s (%s)\\n\",\n+\t\t\ts->amend ? \"# No changes\" : \"nothing to commit\",\n+\t\t\tuse_add_msg);\n }\n \n int git_status_config(const char *k, const char *v)\n-- \n1.4.4.2.g053a\n"},{"id":"30908","messageId":"1168029891.11130.18.camel@ibook.zvpunry.de","threadId":"6237","inReplyTo":"20061216025309.GA19955@spearce.org","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Michael Loeffler","fromEmail":"zvpunry@zvpunry.de","sentAt":"2007-01-05T20:44:51Z","receivedAt":"2007-01-05T20:44:51Z","isPatch":true,"sender":{"key":"zvpunry@zvpunry.de","avatar":null},"body":"Hi,\n\nAm Freitag, den 15.12.2006, 21:53 -0500 schrieb Shawn O. Pearce:\n...\n> @@ -292,7 +291,9 @@ void wt_status_print(struct wt_status *s)\n>  \tif (s->verbose && !s->is_initial)\n>  \t\twt_status_print_verbose(s);\n>  \tif (!s->commitable)\n> -\t\tprintf(\"%s\\n\", s->amend ? \"# No changes\" : \"nothing to commit\");\n> +\t\tprintf(\"%s (%s)\\n\",\n> +\t\t\ts->amend ? \"# No changes\" : \"nothing to commit\",\n> +\t\t\tuse_add_msg);\n>  }\nI don't like the new 'nothing to commit (use \"git add ... message\")'\nmessage. I use git status very often to see if there is something to\ncommit, but now there is always this annoying \"use git add ...\" message.\nI just want to see on what the branch is and if there is something to\ncommit.\n\nIf there is something to commit I get the list of untracked or modified\nfiles with the use_add_msg and if I try to commit an empty tree as\ninitial commit I get the message from git-commit.sh.\n\n\nbye\n"},{"id":"30915","messageId":"7virfldryw.fsf@assigned-by-dhcp.cox.net","threadId":"6237","inReplyTo":"1168029891.11130.18.camel@ibook.zvpunry.de","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-05T22:33:11Z","receivedAt":"2007-01-05T22:33:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Loeffler <zvpunry@zvpunry.de> writes:\n\n> Am Freitag, den 15.12.2006, 21:53 -0500 schrieb Shawn O. Pearce:\n> ...\n>> +\t\tprintf(\"%s (%s)\\n\",\n>> +\t\t\ts->amend ? \"# No changes\" : \"nothing to commit\",\n>> +\t\t\tuse_add_msg);\n>>  }\n> I don't like the new 'nothing to commit (use \"git add ... message\")'\n> message. I use git status very often to see if there is something to\n> commit, but now there is always this annoying \"use git add ...\" message.\n\nI tend to not like _ANY_ change at all, but I've learned to wait\nand see if I get used to it when I see something that annoys me\ninitially, to see if the annoyance is because what it does is\ntruly wrong or it is because what it does is merely different\nfrom what I am used to.\n\nSo I've been trying it out myself as one of the guinea pigs on\nthis one as well.\n\nSo far, my judgement is that this is of the better kind; it is\neasy to get used to, and once you get used to it, it is easily\nignorable.\n\nOther people's tastes may differ, of course.\n"},{"id":"30957","messageId":"7vodpcae9s.fsf@assigned-by-dhcp.cox.net","threadId":"6237","inReplyTo":"7virfldryw.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-06T05:57:19Z","receivedAt":"2007-01-06T05:57:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Michael Loeffler <zvpunry@zvpunry.de> writes:\n>\n>> Am Freitag, den 15.12.2006, 21:53 -0500 schrieb Shawn O. Pearce:\n>> ...\n>>> +\t\tprintf(\"%s (%s)\\n\",\n>>> +\t\t\ts->amend ? \"# No changes\" : \"nothing to commit\",\n>>> +\t\t\tuse_add_msg);\n>>>  }\n>> I don't like the new 'nothing to commit (use \"git add ... message\")'\n>> message. I use git status very often to see if there is something to\n>> commit, but now there is always this annoying \"use git add ...\" message.\n>\n> I tend to not like _ANY_ change at all, but I've learned to wait\n> and see if I get used to it when I see something that annoys me\n> initially, to see if the annoyance is because what it does is\n> truly wrong or it is because what it does is merely different\n> from what I am used to.\n>\n> So I've been trying it out myself as one of the guinea pigs on\n> this one as well.\n>\n> So far, my judgement is that this is of the better kind; it is\n> easy to get used to, and once you get used to it, it is easily\n> ignorable.\n\nHow about doing this?\n\n-- >8 --\ngit-status: squelch \"use 'git add file...'\" message when unneeded\n\nAdd a field in wt_status to record if there are any uncached\nchanges, and use it to decide when there is no point to add the\n\"use 'git add'\" message.\n\n---\n\ndiff --git a/wt-status.c b/wt-status.c\nindex db42738..1037c94 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -15,7 +15,7 @@ static char wt_status_colors[][COLOR_MAXLEN] = {\n \t\"\\033[31m\", /* WT_STATUS_CHANGED: red */\n \t\"\\033[31m\", /* WT_STATUS_UNTRACKED: red */\n };\n-static const char* use_add_msg = \"use \\\"git add file1 file2\\\" to include for commit\";\n+static const char* use_add_msg = \"use \\\"git add file...\\\" to include for commit\";\n \n static int parse_status_slot(const char *var, int offset)\n {\n@@ -162,13 +162,17 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,\n                         struct diff_options *options,\n                         void *data)\n {\n+\tstruct wt_status *s = (struct wt_status *)data;\n \tint i;\n-\tif (q->nr)\n-\t\twt_status_print_header(\"Changed but not added\", use_add_msg);\n+\n+\ts->modified = q->nr;\n+\tif (!q->nr)\n+\t\treturn;\n+\n+\twt_status_print_header(\"Changed but not added\", use_add_msg);\n \tfor (i = 0; i < q->nr; i++)\n \t\twt_status_print_filepair(WT_STATUS_CHANGED, q->queue[i]);\n-\tif (q->nr)\n-\t\twt_status_print_trailer();\n+\twt_status_print_trailer();\n }\n \n void wt_status_print_initial(struct wt_status *s)\n@@ -291,10 +295,14 @@ void wt_status_print(struct wt_status *s)\n \n \tif (s->verbose && !s->is_initial)\n \t\twt_status_print_verbose(s);\n-\tif (!s->commitable)\n-\t\tprintf(\"%s (%s)\\n\",\n-\t\t\ts->amend ? \"# No changes\" : \"nothing to commit\",\n-\t\t\tuse_add_msg);\n+\tif (!s->commitable) {\n+\t\tconst char *msg =\n+\t\t\ts->amend ? \"# No changes\" : \"nothing to commit\";\n+\t\tif (s->modified)\n+\t\t\tprintf(\"%s (%s)\\n\", msg, use_add_msg);\n+\t\telse\n+\t\t\tprintf(\"%s\\n\", msg);\n+\t}\n }\n \n int git_status_config(const char *k, const char *v)\ndiff --git a/wt-status.h b/wt-status.h\nindex 0a5a5b7..72df1b3 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -13,6 +13,7 @@ struct wt_status {\n \tchar *branch;\n \tconst char *reference;\n \tint commitable;\n+\tint modified;\n \tint verbose;\n \tint amend;\n \tint untracked;\n"},{"id":"30969","messageId":"17823.42284.620000.476920@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"7vodpcae9s.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-06T13:33:32Z","receivedAt":"2007-01-06T13:33:32Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Junio C Hamano writes:\n > Junio C Hamano <junkio@cox.net> writes:\n > \n > > Michael Loeffler <zvpunry@zvpunry.de> writes:\n > >\n > >> Am Freitag, den 15.12.2006, 21:53 -0500 schrieb Shawn O. Pearce:\n > >> ...\n > >>> +\t\tprintf(\"%s (%s)\\n\",\n > >>> +\t\t\ts->amend ? \"# No changes\" : \"nothing to commit\",\n > >>> +\t\t\tuse_add_msg);\n > >>>  }\n > >> I don't like the new 'nothing to commit (use \"git add ... message\")'\n > >> message. I use git status very often to see if there is something to\n > >> commit, but now there is always this annoying \"use git add ...\" message.\n > >\n > > I tend to not like _ANY_ change at all, but I've learned to wait\n > > and see if I get used to it when I see something that annoys me\n > > initially, to see if the annoyance is because what it does is\n > > truly wrong or it is because what it does is merely different\n > > from what I am used to.\n > >\n > > So I've been trying it out myself as one of the guinea pigs on\n > > this one as well.\n > >\n > > So far, my judgement is that this is of the better kind; it is\n > > easy to get used to, and once you get used to it, it is easily\n > > ignorable.\n > \n > How about doing this?\n > \n > -- >8 --\n > git-status: squelch \"use 'git add file...'\" message when unneeded\n > \n > Add a field in wt_status to record if there are any uncached\n > changes, and use it to decide when there is no point to add the\n > \"use 'git add'\" message.\n\nCommit 6e458bf63f48fb7d15cb70ad7c7b7b71915d94a2 in next is already\ndoing exactly that. Or am I missing something?\n"},{"id":"30971","messageId":"17823.44049.943881.536532@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"1168029891.11130.18.camel@ibook.zvpunry.de","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-06T14:02:57Z","receivedAt":"2007-01-06T14:02:57Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Michael Loeffler writes:\n > Hi,\n > \n > Am Freitag, den 15.12.2006, 21:53 -0500 schrieb Shawn O. Pearce:\n > ...\n > > @@ -292,7 +291,9 @@ void wt_status_print(struct wt_status *s)\n > >  \tif (s->verbose && !s->is_initial)\n > >  \t\twt_status_print_verbose(s);\n > >  \tif (!s->commitable)\n > > -\t\tprintf(\"%s\\n\", s->amend ? \"# No changes\" : \"nothing to commit\");\n > > +\t\tprintf(\"%s (%s)\\n\",\n > > +\t\t\ts->amend ? \"# No changes\" : \"nothing to commit\",\n > > +\t\t\tuse_add_msg);\n > >  }\n > I don't like the new 'nothing to commit (use \"git add ... message\")'\n > message. I use git status very often to see if there is something to\n > commit, but now there is always this annoying \"use git add ...\" message.\n > I just want to see on what the branch is and if there is something to\n > commit.\n > \n > If there is something to commit I get the list of untracked or modified\n > files with the use_add_msg and if I try to commit an empty tree as\n > initial commit I get the message from git-commit.sh.\n\nI'd appreciate feedback on my series from the 2nd of January,\nespecially part 3/4 (Subject: [PATCH 3/4] Improve \"nothing to commit\"\npart of status output). This is already part of next.\n\nIt removes the message if there really is nothing to commit and\nreplaces it by a generic pointer to git add and git commit if there\nare pending changes in the working directory.\n"},{"id":"30974","messageId":"7vfyao58a7.fsf@assigned-by-dhcp.cox.net","threadId":"6237","inReplyTo":"17823.42284.620000.476920@lapjr.intranet.kiel.bmiag.de","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-06T18:17:52Z","receivedAt":"2007-01-06T18:17:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Juergen Ruehle <j.ruehle@bmiag.de> writes:\n\n>  > How about doing this?\n>  > \n>  > -- >8 --\n>  > git-status: squelch \"use 'git add file...'\" message when unneeded\n>  > \n>  > Add a field in wt_status to record if there are any uncached\n>  > changes, and use it to decide when there is no point to add the\n>  > \"use 'git add'\" message.\n>\n> Commit 6e458bf63f48fb7d15cb70ad7c7b7b71915d94a2 in next is already\n> doing exactly that. Or am I missing something?\n\nIf there is something you are missing, it is that I am\noverloaded these days ;-).\n\nThanks for the reminder.\n"},{"id":"30986","messageId":"17824.10780.295000.771566@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"7vfyao58a7.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-06T23:00:44Z","receivedAt":"2007-01-06T23:00:44Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Junio C Hamano writes:\n > If there is something you are missing, it is that I am\n > overloaded these days ;-).\n\nI'm sorry. As a rather unsuccessful former maintainer of\nhttp://www.openarchitectureware.org/ I can fully appreciate git's luck\nto have such a dedicated maintainer.\n"},{"id":"31119","messageId":"7vslemxe5e.fsf@assigned-by-dhcp.cox.net","threadId":"6237","inReplyTo":"17824.10780.295000.771566@lapjr.intranet.kiel.bmiag.de","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-08T05:48:13Z","receivedAt":"2007-01-08T05:48:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Juergen Ruehle <j.ruehle@bmiag.de> writes:\n\n> Junio C Hamano writes:\n>  > If there is something you are missing, it is that I am\n>  > overloaded these days ;-).\n>\n> I'm sorry. As a rather unsuccessful former maintainer of\n> http://www.openarchitectureware.org/ I can fully appreciate git's luck\n> to have such a dedicated maintainer.\n\nActually there is one difference that I found practically\nimportant.  It usually is a norm for me to have a handful\nuntracked files that I do not even bother adding to .gitignore\nin the repository.  My patch does not suggest \"add\" when there\nare untracked files but no locally modified files.\n"},{"id":"31127","messageId":"17826.8186.10000.584890@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"7vslemxe5e.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-08T10:42:02Z","receivedAt":"2007-01-08T10:42:02Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Junio C Hamano writes:\n > Juergen Ruehle <j.ruehle@bmiag.de> writes:\n > \n > > Junio C Hamano writes:\n > >  > If there is something you are missing, it is that I am\n > >  > overloaded these days ;-).\n > >\n > > I'm sorry. As a rather unsuccessful former maintainer of\n > > http://www.openarchitectureware.org/ I can fully appreciate git's luck\n > > to have such a dedicated maintainer.\n > \n > Actually there is one difference that I found practically\n > important.  It usually is a norm for me to have a handful\n > untracked files that I do not even bother adding to .gitignore\n > in the repository.  My patch does not suggest \"add\" when there\n > are untracked files but no locally modified files.\n\nYes. I don't have a real preference. I have a slight suspicion that\nthe hint is useful for newbies because having only untracked files is\nthe initial situation, but the hint in my patch is actually wrong\nbecause git-commit won't help in this situation. Do you want to revert\nthe patch and apply yours or should I send a correction?\n"},{"id":"31155","messageId":"1168283894.6134.8.camel@ibook.zvpunry.de","threadId":"6237","inReplyTo":"17823.44049.943881.536532@lapjr.intranet.kiel.bmiag.de","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Michael Loeffler","fromEmail":"zvpunry@zvpunry.de","sentAt":"2007-01-08T19:18:14Z","receivedAt":"2007-01-08T19:18:14Z","isPatch":true,"sender":{"key":"zvpunry@zvpunry.de","avatar":null},"body":"hi,\n\nAm Samstag, den 06.01.2007, 15:02 +0100 schrieb Juergen Ruehle:\n...\n> I'd appreciate feedback on my series from the 2nd of January,\n> especially part 3/4 (Subject: [PATCH 3/4] Improve \"nothing to commit\"\n> part of status output). This is already part of next.\nA very positive feedback from me, I like this and it is much better then\njust removing this \"use git add\"-message. ;)\n\nbye michael\n"},{"id":"31159","messageId":"7vps9pwa3e.fsf@assigned-by-dhcp.cox.net","threadId":"6237","inReplyTo":"17826.8186.10000.584890@lapjr.intranet.kiel.bmiag.de","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-08T20:13:25Z","receivedAt":"2007-01-08T20:13:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Juergen Ruehle <j.ruehle@bmiag.de> writes:\n\n> Junio C Hamano writes:\n>  > Juergen Ruehle <j.ruehle@bmiag.de> writes:\n>  > \n>  > > Junio C Hamano writes:\n>  > >  > If there is something you are missing, it is that I am\n>  > >  > overloaded these days ;-).\n>  > >\n>  > > I'm sorry. As a rather unsuccessful former maintainer of\n>  > > http://www.openarchitectureware.org/ I can fully appreciate git's luck\n>  > > to have such a dedicated maintainer.\n>  > \n>  > Actually there is one difference that I found practically\n>  > important.  It usually is a norm for me to have a handful\n>  > untracked files that I do not even bother adding to .gitignore\n>  > in the repository.  My patch does not suggest \"add\" when there\n>  > are untracked files but no locally modified files.\n>\n> Yes. I don't have a real preference. I have a slight suspicion that\n> the hint is useful for newbies because having only untracked files is\n> the initial situation, but the hint in my patch is actually wrong\n> because git-commit won't help in this situation. Do you want to revert\n> the patch and apply yours or should I send a correction?\n\nI think it is Ok to give hints for untracked files -- with\nexperience eyes will learn to ignore them but by then they do\nnot need hints.  Please send in a correction as appropriate.\n"},{"id":"31197","messageId":"17827.11087.870000.177936@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"1168283894.6134.8.camel@ibook.zvpunry.de","subject":"Re: [PATCH 1/2] Suggest use of \"git add file1 file2\" when there is nothing to commit.","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-09T05:42:39Z","receivedAt":"2007-01-09T05:42:39Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Michael Loeffler writes:\n > hi,\n > \n > Am Samstag, den 06.01.2007, 15:02 +0100 schrieb Juergen Ruehle:\n > ...\n > > I'd appreciate feedback on my series from the 2nd of January,\n > > especially part 3/4 (Subject: [PATCH 3/4] Improve \"nothing to commit\"\n > > part of status output). This is already part of next.\n > A very positive feedback from me, I like this and it is much better then\n > just removing this \"use git add\"-message. ;)\n\nHow about Junio's case where there are only untracked files in the\nworking directory? I tend to send a patch that either just prints\n\"nothing to commit\" (simpler) or provides a different message that\njust advertises git-add.\n"},{"id":"31363","messageId":"1168412892113-git-send-email-j.ruehle@bmiag.de","threadId":"6237","inReplyTo":"7vps9pwa3e.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Provide better feedback for the untracked only case in status output","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-10T07:08:12Z","receivedAt":"2007-01-10T07:08:12Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"From: =?utf-8?q?J=C3=BCrgen_R=C3=BChle?= <j-r@online.de>\n\nSince 98bf8a47c296f51ea9722fef4bb81dbfb70cd4bb status would claim that\ngit-commit could be useful even if there are no changes except untracked files.\n\nSince wt-status is already computing all the information go the whole way and\nseparately track the (non-)emptiness of all three sections, unify the code, and\nprovide separate messages for each case. This adds a new message for the\nuntracked only case and adds an explanation for a completely empty working\ndirectory during initial commit.\n\nThis change is effectively reverting 98bf8a47c296f51ea9722fef4bb81dbfb70cd4bb\nand replacing it by a cleaner version.\n\nSigned-off-by: Jürgen Rühle <j-r@online.de>\n---\n  Junio C Hamano writes:\n   > I think it is Ok to give hints for untracked files -- with\n   > experience eyes will learn to ignore them but by then they do\n   > not need hints.  Please send in a correction as appropriate.\n\n  This should provide useful feedback for the nothing to commit case in any\n  situation. It is how I should have done it initially. Sorry for wasting your\n  time.\n\n  Still missing:\n\n   - Further changes to the header messages (as discussed on the list)\n\n   - Patches to every other file that contains these messages verbatim\n\n     (AFAICS this affects only the git-reset man page, tutorial-2 and the VIM\n      syntax highlighting)\n\n wt-status.c |   21 ++++++++++++---------\n wt-status.h |    6 ++++--\n 2 files changed, 16 insertions(+), 11 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex c48127d..5190bde 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -47,10 +47,11 @@ void wt_status_prepare(struct wt_status *s)\n \ts->reference = \"HEAD\";\n \ts->amend = 0;\n \ts->verbose = 0;\n-\ts->commitable = 0;\n \ts->untracked = 0;\n \n-\ts->workdir_clean = 1;\n+\ts->commitable = 0;\n+\ts->workdir_dirty = 0;\n+\ts->workdir_untracked = 0;\n }\n \n static void wt_status_print_cached_header(const char *reference)\n@@ -176,7 +177,7 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,\n \tstruct wt_status *s = data;\n \tint i;\n \tif (q->nr) {\n-\t\ts->workdir_clean = 0;\n+\t\ts->workdir_dirty = 1;\n \t\twt_status_print_header(\"Changed but not added\", use_add_msg);\n \t}\n \tfor (i = 0; i < q->nr; i++)\n@@ -263,7 +264,7 @@ static void wt_status_print_untracked(struct wt_status *s)\n \t\t\t\tcontinue;\n \t\t}\n \t\tif (!shown_header) {\n-\t\t\ts->workdir_clean = 0;\n+\t\t\ts->workdir_untracked = 1;\n \t\t\twt_status_print_header(\"Untracked files\", use_add_msg);\n \t\t\tshown_header = 1;\n \t\t}\n@@ -311,12 +312,14 @@ void wt_status_print(struct wt_status *s)\n \tif (!s->commitable) {\n \t\tif (s->amend)\n \t\t\tprintf(\"# No changes\\n\");\n-\t\telse if (s->workdir_clean)\n-\t\t\tprintf(s->is_initial\n-\t\t\t       ? \"nothing to commit\\n\"\n-\t\t\t       : \"nothing to commit (working directory matches HEAD)\\n\");\n-\t\telse\n+\t\telse if (s->workdir_dirty)\n \t\t\tprintf(\"no changes added to commit (use \\\"git add\\\" and/or \\\"git commit [-a|-i|-o]\\\")\\n\");\n+\t\telse if (s->workdir_untracked)\n+\t\t\tprintf(\"nothing added to commit but untracked files present (use \\\"git add\\\" to track)\\n\");\n+\t\telse if (s->is_initial)\n+\t\t\tprintf(\"nothing to commit (working directory is empty)\\n\");\n+\t\telse\n+\t\t\tprintf(\"nothing to commit (working directory matches HEAD)\\n\");\n \t}\n }\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 892a86c..cfea4ae 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -12,11 +12,13 @@ struct wt_status {\n \tint is_initial;\n \tchar *branch;\n \tconst char *reference;\n-\tint commitable;\n \tint verbose;\n \tint amend;\n \tint untracked;\n-\tint workdir_clean;\n+\t/* These are computed during processing of the individual sections */\n+\tint commitable;\n+\tint workdir_dirty;\n+\tint workdir_untracked;\n };\n \n int git_status_config(const char *var, const char *value);\n-- \n1.5.0.rc0.g525e\n"},{"id":"31364","messageId":"17828.37642.473000.296809@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"1168412892113-git-send-email-j.ruehle@bmiag.de","subject":"Re: [PATCH] Provide better feedback for the untracked only case in status output","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-10T07:17:30Z","receivedAt":"2007-01-10T07:17:30Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Juergen Ruehle writes:\n > [Corrupted patch deleted]\n\nWill try again when I know what happened.\n"},{"id":"31365","messageId":"17828.38342.510000.691826@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"17828.37642.473000.296809@lapjr.intranet.kiel.bmiag.de","subject":"Re: [PATCH] Provide better feedback for the untracked only case in status output","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-10T07:29:10Z","receivedAt":"2007-01-10T07:29:10Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Juergen Ruehle writes:\n > Juergen Ruehle writes:\n >  > [Corrupted patch deleted]\n\nActually the patch is ok as sent (somehow my MUA was adding CRs when\nlocally saving the patch). Sorry for the noise.\n"},{"id":"31366","messageId":"7v4pqzfhzd.fsf@assigned-by-dhcp.cox.net","threadId":"6237","inReplyTo":"17828.37642.473000.296809@lapjr.intranet.kiel.bmiag.de","subject":"Re: [PATCH] Provide better feedback for the untracked only case in status output","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-10T07:39:34Z","receivedAt":"2007-01-10T07:39:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Juergen Ruehle <j.ruehle@bmiag.de> writes:\n\n> Juergen Ruehle writes:\n>  > [Corrupted patch deleted]\n>\n> Will try again when I know what happened.\n\nWhile you are at it, let me point out one thing that has been\nannoying me for a while.\n\nThis is an example e-mail I have been getting from you (the\nbelow is before decoding MIME):\n\n  From: Juergen Ruehle <j.ruehle@bmiag.de>\n  Subject: [PATCH] Provide better feedback for the ...\n  Date: Wed, 10 Jan 2007 08:08:12 +0100\n  Message-ID: <1168412892113-git-send-email-j.ruehle@bmiag.de>\n  Content-Type: text/plain; charset=UTF-8\n  Content-Transfer-Encoding: quoted-printable\n  Cc: git@vger.kernel.org,\n          =?utf-8?q?J=C3=BCrgen_R=C3=BChle?= <j-r@online.de>\n  X-Mailer: git-send-email 1.5.0.rc0.g525e\n\n  From: =3D?utf-8?q?J=3DC3=3DBCrgen_R=3DC3=3DBChle?=3D <j-r@online.de>\n\n  Since 98bf8a47c296f51ea9722fef4bb81dbfb70cd4bb status would claim that\n  git-commit could be useful even if there are no changes except untracked =\n  files.\n\n  Since wt-status is already computing all the information go the whole way=\n   and\n  separately track the (non-)emptiness of all three sections, unify the cod=\n  e, and\n  provide separate messages for each case. This adds a new message for the\n  untracked only case and adds an explanation for a completely empty workin=\n  g\n  directory during initial commit.\n\n  This change is effectively reverting 98bf8a47c296f51ea9722fef4bb81dbfb70c=\n  d4bb\n  and replacing it by a cleaner version.\n\n  Signed-off-by: J=C3=BCrgen R=C3=BChle <j-r@online.de>\n\nNotice:\n\n * The message claims to be from git-send-email;\n\n * Content-Type and CTE are UTF-8 and QP (which is fine);\n\n * You have in-body From: line; this is not wrong per-se and I\n   understand why you would want one (your e-mail From: line\n   uses ASCII approximations \"ue\" and \"ue\" and you would want\n   the resulting commit to spell your name correctly).\n\n * However, this in-body From: line is _doubly_ QP encoded (what\n   you see above is your name, first RFC 2047 encoded and then\n   QP encoded).  It shouldn't be.\n\nSo, my questions are:\n\n (1) is this what git-send-email generates and sends out by\n     default?  If so that means it is a bug in that program that\n     needs to be fixed.\n\n (2) if not, are you inserting the in-body From: by hand,\n     perhaps cut & paste from format-patch output, before\n     feeding git-send-email (which runs QP on it)?\n\nIf the latter, please do not paste the RFC 2047 quoted form.\nYou can spell your name in raw UTF-8 on the in-body From: line\njust like you did on your Signed-off-by: line.\n"},{"id":"31403","messageId":"1168452977.19643.57.camel@ibook.zvpunry.de","threadId":"6237","inReplyTo":"1168412892113-git-send-email-j.ruehle@bmiag.de","subject":"Re: [PATCH] Provide better feedback for the untracked only case in status output","fromName":"Michael Loeffler","fromEmail":"zvpunry@zvpunry.de","sentAt":"2007-01-10T18:16:16Z","receivedAt":"2007-01-10T18:16:16Z","isPatch":true,"sender":{"key":"zvpunry@zvpunry.de","avatar":null},"body":"hi,\n\nAm Mittwoch, den 10.01.2007, 08:08 +0100 schrieb Juergen Ruehle:\n...\n> @@ -311,12 +312,14 @@ void wt_status_print(struct wt_status *s)\n...\n> +\t\telse if (s->is_initial)\n> +\t\t\tprintf(\"nothing to commit (working directory is empty)\\n\");\nShouldn't the user know that there is nothing in his working directory?\n\n> +\t\telse\n> +\t\t\tprintf(\"nothing to commit (working directory matches HEAD)\\n\");\nHow about s/matches HEAD/clean/\n\nThere is another thing:\n# Changed but not added:\n#   (use \"git add <file>...\" to incrementally add content to commit)\n#\n#       deleted:    blah\n\nHow about adding some more hints (e.g.: git rm --cached <file>)\ndepending on the diff_queue in wt_status_print_changed_cb()?\n\n\nbye michael\n"},{"id":"31404","messageId":"17829.12657.814000.514351@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"7v4pqzfhzd.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Provide better feedback for the untracked only case in status output","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-10T18:33:21Z","receivedAt":"2007-01-10T18:33:21Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Junio C Hamano writes:\n > Juergen Ruehle <j.ruehle@bmiag.de> writes:\n > \n > > Juergen Ruehle writes:\n > >  > [Corrupted patch deleted]\n > >\n > > Will try again when I know what happened.\n > \n > While you are at it, let me point out one thing that has been\n > annoying me for a while.\n > \n >  * The message claims to be from git-send-email;\n > \n >  * Content-Type and CTE are UTF-8 and QP (which is fine);\n > \n >  * You have in-body From: line; this is not wrong per-se and I\n >    understand why you would want one (your e-mail From: line\n >    uses ASCII approximations \"ue\" and \"ue\" and you would want\n >    the resulting commit to spell your name correctly).\n >\n >  * However, this in-body From: line is _doubly_ QP encoded (what\n >    you see above is your name, first RFC 2047 encoded and then\n >    QP encoded).  It shouldn't be.\n > \n > So, my questions are:\n > \n >  (1) is this what git-send-email generates and sends out by\n >      default?  If so that means it is a bug in that program that\n >      needs to be fixed.\n > \n >  (2) if not, are you inserting the in-body From: by hand,\n >      perhaps cut & paste from format-patch output, before\n >      feeding git-send-email (which runs QP on it)?\n > \n > If the latter, please do not paste the RFC 2047 quoted form.\n > You can spell your name in raw UTF-8 on the in-body From: line\n > just like you did on your Signed-off-by: line.\n\nYes, this is using git-send-email which sends the mail as 8bit encoded\nand provides the QP encoded From line. Unfortunately there seems to be\na gateway in between that doesn't handle 8bit and QPs the mail again.\nPerhaps I need some other switches for format-patch and send-email to\nproduce a better result? I'll take another look at the documentation\nbefore annoying you again.\n"},{"id":"31408","messageId":"11684596371612-git-send-email-j.ruehle@bmiag.de","threadId":"6237","inReplyTo":"17829.12657.814000.514351@lapjr.intranet.kiel.bmiag.de","subject":"[PATCH] Quick hack to avoid double qp encoding","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-10T20:07:17Z","receivedAt":"2007-01-10T20:07:17Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"From: JÃ¼rgen_RÃ¼hle <j-r@online.de>\n\nSigned-off-by: JÃ¼rgen RÃ¼hle <j-r@online.de>\n---\n This is just a hack since I know next to nothing about perl.\n\n git-send-email.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex ba39d39..a4a22d3 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -555,6 +555,7 @@ foreach my $t (@files) {\n \t}\n \tclose F;\n \tif (defined $author_not_sender) {\n+\t\t$author_not_sender =~ s/=\\?utf-8\\?q\\?([^?]*)\\?=/my $bla = $1; $bla =~ s|=([0-9a-fA-F]{2})|sprintf '%c', hex($1)|eg; $bla/eg;\n \t\t$message = \"From: $author_not_sender\\n\\n$message\";\n \t}\n \n-- \n1.5.0.rc0.g525e\n"},{"id":"31410","messageId":"17829.18722.194000.927872@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"1168452977.19643.57.camel@ibook.zvpunry.de","subject":"Re: [PATCH] Provide better feedback for the untracked only case in status output","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-10T20:14:26Z","receivedAt":"2007-01-10T20:14:26Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Michael Loeffler writes:\n > hi,\n > \n > Am Mittwoch, den 10.01.2007, 08:08 +0100 schrieb Juergen Ruehle:\n > ...\n > > @@ -311,12 +312,14 @@ void wt_status_print(struct wt_status *s)\n > ...\n > > +\t\telse if (s->is_initial)\n > > +\t\t\tprintf(\"nothing to commit (working directory is empty)\\n\");\n > Shouldn't the user know that there is nothing in his working directory?\n\n:-)\n\nWell this is the state directly after git-init, e.g. the very first\ncontact with git. Perhaps we should write:\n\nnothing to commit (create files in the working directory and use git add)\n\n > > +\t\telse\n > > +\t\t\tprintf(\"nothing to commit (working directory matches HEAD)\\n\");\n > How about s/matches HEAD/clean/\n\nI like that.\n\n > There is another thing:\n > # Changed but not added:\n > #   (use \"git add <file>...\" to incrementally add content to commit)\n > #\n > #       deleted:    blah\n > \n > How about adding some more hints (e.g.: git rm --cached <file>)\n > depending on the diff_queue in wt_status_print_changed_cb()?\n\nYes, there's always one more case to consider:-)\n"},{"id":"31412","messageId":"17829.20111.652000.250228@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"11684596371612-git-send-email-j.ruehle@bmiag.de","subject":"Re: [PATCH] Quick hack to avoid double qp encoding","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-10T20:37:35Z","receivedAt":"2007-01-10T20:37:35Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Juergen Ruehle writes:\n > From: JÃ¼rgen_RÃ¼hle <j-r@online.de>\n                ^\n\nOk, i should have also reverted the ' ' to '_' conversion, but it\nseems that send-email is to blame, because it simply copies the\n(possibly) QP encoded author address into the body of a (possibly) not\nQP encoded message.\n\n > Signed-off-by: JÃ¼rgen RÃ¼hle <j-r@online.de>\n > ---\n >  This is just a hack since I know next to nothing about perl.\n > \n >  git-send-email.perl |    1 +\n >  1 files changed, 1 insertions(+), 0 deletions(-)\n > \n > diff --git a/git-send-email.perl b/git-send-email.perl\n > index ba39d39..a4a22d3 100755\n > --- a/git-send-email.perl\n > +++ b/git-send-email.perl\n > @@ -555,6 +555,7 @@ foreach my $t (@files) {\n >  \t}\n >  \tclose F;\n >  \tif (defined $author_not_sender) {\n > +\t\t$author_not_sender =~ s/=\\?utf-8\\?q\\?([^?]*)\\?=/my $bla = $1; $bla =~ s|=([0-9a-fA-F]{2})|sprintf '%c', hex($1)|eg; $bla/eg;\n\n+\t\t$author_not_sender =~ s/=\\?utf-8\\?q\\?([^?]*)\\?=/my $bla = $1; $bla =~ s|_| |g; $bla =~ s|=([0-9a-fA-F]{2})|sprintf '%c', hex($1)|eg; $bla/eg;\n\n >  \t\t$message = \"From: $author_not_sender\\n\\n$message\";\n >  \t}\n >  \n > -- \n > 1.5.0.rc0.g525e\n"},{"id":"31414","messageId":"7vd55ma7ur.fsf@assigned-by-dhcp.cox.net","threadId":"6237","inReplyTo":"17829.20111.652000.250228@lapjr.intranet.kiel.bmiag.de","subject":"Re: [PATCH] Quick hack to avoid double qp encoding","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-10T21:29:32Z","receivedAt":"2007-01-10T21:29:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Juergen Ruehle <j.ruehle@bmiag.de> writes:\n\n> Juergen Ruehle writes:\n>\n> Ok, i should have also reverted the ' ' to '_' conversion, but it\n> seems that send-email is to blame, because it simply copies the\n> (possibly) QP encoded author address into the body of a (possibly) not\n> QP encoded message.\n\nThanks.  I think other people would want to hack on this, so I\nwould make a separete sub to make it easier, like this:\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex ba39d39..8dc2ee0 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -402,6 +402,15 @@ sub make_message_id\n $cc = \"\";\n $time = time - scalar $#files;\n \n+sub unquote_rfc2047 {\n+\tlocal ($_) = @_;\n+\tif (s/=\\?utf-8\\?q\\?(.*)\\?=/$1/g) {\n+\t\ts/_/ /g;\n+\t\ts/=([0-9A-F]{2})/chr(hex($1))/eg;\n+\t}\n+\treturn \"$_ - unquoted\";\n+}\n+\n sub send_message\n {\n \tmy @recipients = unique_email_list(@to);\n@@ -555,6 +564,7 @@ foreach my $t (@files) {\n \t}\n \tclose F;\n \tif (defined $author_not_sender) {\n+\t\t$author_not_sender = unquote_rfc2047($author_not_sender);\n \t\t$message = \"From: $author_not_sender\\n\\n$message\";\n \t}\n \n"},{"id":"31416","messageId":"11684679032630-git-send-email-j.ruehle@bmiag.de","threadId":"6237","inReplyTo":"1168452977.19643.57.camel@ibook.zvpunry.de","subject":"[PATCH] Provide better feedback for the untracked only case in status output","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-10T22:25:03Z","receivedAt":"2007-01-10T22:25:03Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"From: JÃ¼rgen RÃ¼hle <j-r@online.de>\n\nSince 98bf8a47c296f51ea9722fef4bb81dbfb70cd4bb status would claim that\ngit-commit could be useful even if there are no changes except untracked files.\n\nSince wt-status is already computing all the information needed go the whole\nway and actually track the (non-)emptiness of all three sections separately,\nunify the code, and provide useful messages for each individual case.\n\nThanks to Junio and Michael Loeffler for suggestions.\n\nSigned-off-by: JÃ¼rgen RÃ¼hle <j-r@online.de>\n---\n  This is a resend of the nothing-to-commit improvement patch (hopefully)\n  without corruption. This also includes some changes due to feedback from\n  Michael Loeffler.\n\n  Still missing:\n\n   - Further changes to the other messages (as discussed on the list)\n\n   - Patches to other files that contain these messages verbatim\n\n     (AFAICS this affects only the git-reset man page, tutorial-2 and the VIM\n      syntax highlighting)\n\n wt-status.c |   21 ++++++++++++---------\n wt-status.h |    6 ++++--\n 2 files changed, 16 insertions(+), 11 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex c48127d..1dc2fdc 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -47,10 +47,11 @@ void wt_status_prepare(struct wt_status *s)\n \ts->reference = \"HEAD\";\n \ts->amend = 0;\n \ts->verbose = 0;\n-\ts->commitable = 0;\n \ts->untracked = 0;\n \n-\ts->workdir_clean = 1;\n+\ts->commitable = 0;\n+\ts->workdir_dirty = 0;\n+\ts->workdir_untracked = 0;\n }\n \n static void wt_status_print_cached_header(const char *reference)\n@@ -176,7 +177,7 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,\n \tstruct wt_status *s = data;\n \tint i;\n \tif (q->nr) {\n-\t\ts->workdir_clean = 0;\n+\t\ts->workdir_dirty = 1;\n \t\twt_status_print_header(\"Changed but not added\", use_add_msg);\n \t}\n \tfor (i = 0; i < q->nr; i++)\n@@ -263,7 +264,7 @@ static void wt_status_print_untracked(struct wt_status *s)\n \t\t\t\tcontinue;\n \t\t}\n \t\tif (!shown_header) {\n-\t\t\ts->workdir_clean = 0;\n+\t\t\ts->workdir_untracked = 1;\n \t\t\twt_status_print_header(\"Untracked files\", use_add_msg);\n \t\t\tshown_header = 1;\n \t\t}\n@@ -311,12 +312,14 @@ void wt_status_print(struct wt_status *s)\n \tif (!s->commitable) {\n \t\tif (s->amend)\n \t\t\tprintf(\"# No changes\\n\");\n-\t\telse if (s->workdir_clean)\n-\t\t\tprintf(s->is_initial\n-\t\t\t       ? \"nothing to commit\\n\"\n-\t\t\t       : \"nothing to commit (working directory matches HEAD)\\n\");\n-\t\telse\n+\t\telse if (s->workdir_dirty)\n \t\t\tprintf(\"no changes added to commit (use \\\"git add\\\" and/or \\\"git commit [-a|-i|-o]\\\")\\n\");\n+\t\telse if (s->workdir_untracked)\n+\t\t\tprintf(\"nothing added to commit but untracked files present (use \\\"git add\\\" to track)\\n\");\n+\t\telse if (s->is_initial)\n+\t\t\tprintf(\"nothing to commit (create/copy files and use \\\"git add\\\" to track)\\n\");\n+\t\telse\n+\t\t\tprintf(\"nothing to commit (working directory clean)\\n\");\n \t}\n }\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 892a86c..cfea4ae 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -12,11 +12,13 @@ struct wt_status {\n \tint is_initial;\n \tchar *branch;\n \tconst char *reference;\n-\tint commitable;\n \tint verbose;\n \tint amend;\n \tint untracked;\n-\tint workdir_clean;\n+\t/* These are computed during processing of the individual sections */\n+\tint commitable;\n+\tint workdir_dirty;\n+\tint workdir_untracked;\n };\n \n int git_status_config(const char *var, const char *value);\n-- \n1.5.0.rc0.g525e\n"},{"id":"31417","messageId":"20070110222914.GA22838@coredump.intra.peff.net","threadId":"6237","inReplyTo":"11684679032630-git-send-email-j.ruehle@bmiag.de","subject":"Re: [PATCH] Provide better feedback for the untracked only case in status output","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-01-10T22:29:15Z","receivedAt":"2007-01-10T22:29:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jan 10, 2007 at 11:25:03PM +0100, Juergen Ruehle wrote:\n\n>    - Patches to other files that contain these messages verbatim\n>      (AFAICS this affects only the git-reset man page, tutorial-2 and the VIM\n>       syntax highlighting)\n\nI have been tracking these changes for the vim highlighting, but have\nbeen waiting for things to settle before sending a patch (which should\nhopefully go into v1.5.0, but I will wait until this is finalized).\n\n-Peff\n"},{"id":"31433","messageId":"17829.58488.697000.282686@lapjr.intranet.kiel.bmiag.de","threadId":"6237","inReplyTo":"20070110222914.GA22838@coredump.intra.peff.net","subject":"Re: [PATCH] Provide better feedback for the untracked only case in status output","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-11T07:17:12Z","receivedAt":"2007-01-11T07:17:12Z","isPatch":true,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Jeff King writes:\n > On Wed, Jan 10, 2007 at 11:25:03PM +0100, Juergen Ruehle wrote:\n > \n > >    - Patches to other files that contain these messages verbatim\n > >      (AFAICS this affects only the git-reset man page, tutorial-2 and the VIM\n > >       syntax highlighting)\n > \n > I have been tracking these changes for the vim highlighting, but have\n > been waiting for things to settle before sending a patch (which should\n > hopefully go into v1.5.0, but I will wait until this is finalized).\n\nThanks for tracking this. It would be nice if we could make the\nsyntax highlighting less dependent on the exact wording.\n"}]}