This allows the caller to add an informational message at the
beginning of the diff, when output is produced by diff_flush().
It (ab)uses the WHITESPACE color; we should probably have named
that as WARNING color instead, as the existing use is already
about warnings.
Nobody uses this yet, but the next one does.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff.c | 7 +++++++
diff.h | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index d8f9242..3cdb47a 100644
--- a/diff.c
+++ b/diff.c
@@ -2796,6 +2796,13 @@ void diff_flush(struct diff_options *options)
if (!q->nr)
goto free_queue;
+ if (options->warning) {
+ const char *reset, *set;
+ set = diff_get_color(options->color_diff, DIFF_WHITESPACE);
+ reset = diff_get_color(options->color_diff, DIFF_RESET);
+ printf("%s%s%s\n", set, options->warning, reset);
+ }
+
if (output_format & (DIFF_FORMAT_RAW |
DIFF_FORMAT_NAME |
DIFF_FORMAT_NAME_STATUS |
diff --git a/diff.h b/diff.h
index a0d2ce1..2fc86eb 100644
--- a/diff.h
+++ b/diff.h
@@ -48,6 +48,7 @@ struct diff_options {
const char *orderfile;
const char *pickaxe;
const char *single_follow;
+ const char *warning;
unsigned recursive:1,
tree_in_recursive:1,
binary:1,
--
1.5.1.777.gd14d3
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Matheos Worku | 2.6.24 BUG: soft lockup - CPU#X |
