{"thread":{"id":"8024","subject":"[PATCH] Change all git-status output to be \"comments\"","startedAt":"2007-05-08T02:13:56Z","lastAt":"2007-05-08T21:07:12Z","messageCount":2,"participants":["Shawn O. Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"41392","messageId":"20070508021355.GA22383@spearce.org","threadId":"8024","inReplyTo":null,"subject":"[PATCH] Change all git-status output to be \"comments\"","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-05-08T02:13:56Z","receivedAt":"2007-05-08T02:13:56Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"You wouldn't believe how many of my merge commits end with\nthe following message from git-status:\n\n  \"nothing to commit (working directory clean)\"\n\nThis happens because of the way I sometimes create (and resolve)\nsome types of merges.  My commit message buffer gets prepped with\nthe output of git-status, which has this nice message way down at the\nbottom of the file, below a large-ish block of lines that start with\n\"#\".  Since git-commit strips those lines, I always fail to see the\ntrailing line that doesn't start with \"#\" and consequently fail to\nsee that \"nothing to commit ...\" will be part of my merge message.\n\nSo always comment out the output of git-status.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n wt-status.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex a055990..a9ba1ae 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -336,13 +336,13 @@ void wt_status_print(struct wt_status *s)\n \t\tif (s->amend)\n \t\t\tprintf(\"# No changes\\n\");\n \t\telse if (s->workdir_dirty)\n-\t\t\tprintf(\"no changes added to commit (use \\\"git add\\\" and/or \\\"git commit -a\\\")\\n\");\n+\t\t\tprintf(\"# no changes added to commit (use \\\"git add\\\" and/or \\\"git commit -a\\\")\\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\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\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\t\tprintf(\"# nothing to commit (working directory clean)\\n\");\n \t}\n }\n \n-- \n1.5.2.rc2.716.gba45c\n"},{"id":"41502","messageId":"7v3b272fen.fsf@assigned-by-dhcp.cox.net","threadId":"8024","inReplyTo":"20070508021355.GA22383@spearce.org","subject":"Re: [PATCH] Change all git-status output to be \"comments\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-08T21:07:12Z","receivedAt":"2007-05-08T21:07:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> You wouldn't believe how many of my merge commits end with\n> the following message from git-status:\n>\n>   \"nothing to commit (working directory clean)\"\n>\n> This happens because of the way I sometimes create (and resolve)\n> some types of merges.  My commit message buffer gets prepped with\n> the output of git-status, which has this nice message way down at the\n> bottom of the file, below a large-ish block of lines that start with\n> \"#\".  Since git-commit strips those lines, I always fail to see the\n> trailing line that doesn't start with \"#\" and consequently fail to\n> see that \"nothing to commit ...\" will be part of my merge message.\n>\n> So always comment out the output of git-status.\n\nI think a better change would be to remove the 'nothing to\ncommit' when recording a merge.  The tool strongly discourage\ncreating an empty commit (iow, \"diff-tree it^ it\" is empty) for\na single parent case, while a merge that ends up (even when you\ndid not use \"ours\" strategy but resolved \"fixing the same bug,\nbut differently\" conflicts by hand) nullifying everything the\nother side did is a perfectly normal merge.\n\nI do not have a strong feeling against saying '# ' in front of\n'nothing to commit' in the non-merge cases, other than that the\ncurrent one makes the 'nothing to commit' message itself stand\nout in 'git status' output.  There also is a small issue of\nupdating the documentation and retraining people.  We need to\ngrep and replace them in the documentation and tutorial, and\nstart telling people who learn older copies of documentation\ngoogle finds that the older git said things slightly\ndifferently.\n"}]}