diff options
author | Junio C Hamano <junkio@cox.net> | 2006-06-27 15:08:19 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-06-27 15:33:40 -0700 |
commit | 3969cf7db1a13a78f3b7a36d8c1084bbe0a53459 (patch) | |
tree | 2b16523d7552997a7c3f562a4f2bffbc207a926c /diff.c | |
parent | a959e0dc16907c4dc123cfac7bd22c636064a638 (diff) | |
download | git-3969cf7db1a13a78f3b7a36d8c1084bbe0a53459.tar.gz git-3969cf7db1a13a78f3b7a36d8c1084bbe0a53459.tar.xz |
Fix some more diff options changes.
This fixes various problems in the new diff options code.
- Fix --cc/-c --patch; it showed two-tree diff used internally.
- Use "---\n" only where it matters -- that is, use it
immediately after the commit log text when we show a
commit log and something else before the patch text.
- Do not output spurious extra "\n"; have an extra newline
after the commit log text always when we have diff output and
we are not doing oneline.
- When running a pickaxe you need to go recursive.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1424,7 +1424,7 @@ void diff_setup(struct diff_options *options) options->break_opt = -1; options->rename_limit = -1; options->context = 3; - options->msg_sep = "\n"; + options->msg_sep = ""; options->change = diff_change; options->add_remove = diff_addremove; @@ -1455,6 +1455,11 @@ int diff_setup_done(struct diff_options *options) DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_CHECKDIFF)) options->recursive = 1; + /* + * Also pickaxe would not work very well if you do not say recursive + */ + if (options->pickaxe) + options->recursive = 1; if (options->detect_rename && options->rename_limit < 0) options->rename_limit = diff_rename_limit_default; @@ -2143,9 +2148,6 @@ void diff_flush(struct diff_options *options) if (output_format & DIFF_FORMAT_DIFFSTAT) { struct diffstat_t diffstat; - if (separator++) - putchar('\n'); - memset(&diffstat, 0, sizeof(struct diffstat_t)); diffstat.xm.consume = diffstat_consume; for (i = 0; i < q->nr; i++) { @@ -2154,14 +2156,13 @@ void diff_flush(struct diff_options *options) diff_flush_stat(p, options, &diffstat); } show_stats(&diffstat); + separator++; } if (output_format & DIFF_FORMAT_SUMMARY && !is_summary_empty(q)) { - if (separator++) - putchar('\n'); - for (i = 0; i < q->nr; i++) diff_summary(q->queue[i]); + separator++; } if (output_format & DIFF_FORMAT_PATCH) { |