diff --stat: do not do its own three-dashes.
authorJunio C Hamano <junkio@cox.net>
Sat, 15 Apr 2006 21:02:10 +0000 (14:02 -0700)
committerJunio C Hamano <junkio@cox.net>
Sat, 15 Apr 2006 21:06:42 +0000 (14:06 -0700)
I missed that "git-diff-* --stat" spits out three-dash separator
on its own without being asked.  Remove it.

When we output commit log followed by diff, perhaps --patch-with-stat,
for downstream consumer, we _would_ want the three-dash between
the message and the diff material, but that logic belongs to the
caller, not diff generator.

Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c
git.c

diff --git a/diff.c b/diff.c
index f1b672d..cda8d20 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -245,8 +245,6 @@ static void show_stats(struct diffstat_t* data)
        if (data->nr == 0)
                return;
 
-       printf("---\n");
-
        for (i = 0; i < data->nr; i++) {
                struct diffstat_file *file = data->files[i];
 
diff --git a/git.c b/git.c
index 78ed403..61265a8 100644 (file)
--- a/git.c
+++ b/git.c
@@ -388,8 +388,10 @@ static int cmd_log(int argc, const char **argv, char **envp)
                pretty_print_commit(commit_format, commit, ~0, buf,
                                    LOGSIZE, abbrev);
                printf("%s\n", buf);
-               if (do_diff)
+               if (do_diff) {
+                       printf("---\n");
                        log_tree_commit(&opt, commit);
+               }
                shown = 1;
                free(commit->buffer);
                commit->buffer = NULL;