{"thread":{"id":"3885","subject":"[PATCH] diff --stat: do not do its own three-dashes.","startedAt":"2006-04-15T21:10:39Z","lastAt":"2006-04-15T21:10:39Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"18716","messageId":"7virpaee9c.fsf@assigned-by-dhcp.cox.net","threadId":"3885","inReplyTo":null,"subject":"[PATCH] diff --stat: do not do its own three-dashes.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-15T21:10:39Z","receivedAt":"2006-04-15T21:10:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I missed that \"git-diff-* --stat\" spits out three-dash separator\non its own without being asked.  Remove it.\n\nWhen we output commit log followed by diff, perhaps --patch-with-stat,\nfor downstream consumer, we _would_ want the three-dash between\nthe message and the diff material, but that logic belongs to the\ncaller, not diff generator.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n * Now the next task is to make \"git log\" not to do its own\n   commit formatting, but let the log_tree_commit() do it, just\n   like we do in diff-tree --pretty.  This would open the door\n   for us to (optionally) omit log message when there is no\n   diff, and honor the --max-count by counting what we actually\n   output.\n\n   When that happens, the printf() I moved tentatively to\n   cmd_log() should become part of the commit formatting\n   log_tree_commit() does, perhaps with --pretty=format-patch.\n\n diff.c |    2 --\n git.c  |    4 +++-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\n6f4780f9dfd3bc6b23f9ea66b3d49577e0a0c2f9\ndiff --git a/diff.c b/diff.c\nindex f1b672d..cda8d20 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -245,8 +245,6 @@ static void show_stats(struct diffstat_t\n \tif (data->nr == 0)\n \t\treturn;\n \n-\tprintf(\"---\\n\");\n-\n \tfor (i = 0; i < data->nr; i++) {\n \t\tstruct diffstat_file *file = data->files[i];\n \ndiff --git a/git.c b/git.c\nindex 78ed403..61265a8 100644\n--- a/git.c\n+++ b/git.c\n@@ -388,8 +388,10 @@ static int cmd_log(int argc, const char \n \t\tpretty_print_commit(commit_format, commit, ~0, buf,\n \t\t\t\t    LOGSIZE, abbrev);\n \t\tprintf(\"%s\\n\", buf);\n-\t\tif (do_diff)\n+\t\tif (do_diff) {\n+\t\t\tprintf(\"---\\n\");\n \t\t\tlog_tree_commit(&opt, commit);\n+\t\t}\n \t\tshown = 1;\n \t\tfree(commit->buffer);\n \t\tcommit->buffer = NULL;\n-- \n1.3.0.rc4.g5a48-dirty\n"}]}