diff.c: add --output-indicator-{new, old, context}
[gitweb.git] / diff.h
diff --git a/diff.h b/diff.h
index d29560f822ca0ee4738f769e2feb3939851d7ff1..d7edc64454a443331176e926097a4600d3648dae 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -94,6 +94,8 @@ struct diff_flags {
        unsigned funccontext:1;
        unsigned default_follow_renames:1;
        unsigned stat_with_summary:1;
+       unsigned suppress_diff_headers:1;
+       unsigned dual_color_diffed_diffs:1;
 };
 
 static inline void diff_flags_or(struct diff_flags *a,
@@ -192,6 +194,11 @@ struct diff_options {
        FILE *file;
        int close_file;
 
+#define OUTPUT_INDICATOR_NEW 0
+#define OUTPUT_INDICATOR_OLD 1
+#define OUTPUT_INDICATOR_CONTEXT 2
+       char output_indicators[3];
+
        struct pathspec pathspec;
        pathchange_fn_t pathchange;
        change_fn_t change;
@@ -208,11 +215,16 @@ struct diff_options {
        enum {
                COLOR_MOVED_NO = 0,
                COLOR_MOVED_PLAIN = 1,
-               COLOR_MOVED_ZEBRA = 2,
-               COLOR_MOVED_ZEBRA_DIM = 3,
+               COLOR_MOVED_BLOCKS = 2,
+               COLOR_MOVED_ZEBRA = 3,
+               COLOR_MOVED_ZEBRA_DIM = 4,
        } color_moved;
        #define COLOR_MOVED_DEFAULT COLOR_MOVED_ZEBRA
        #define COLOR_MOVED_MIN_ALNUM_COUNT 20
+
+       /* XDF_WHITESPACE_FLAGS regarding block detection are set at 2, 3, 4 */
+       #define COLOR_MOVED_WS_ALLOW_INDENTATION_CHANGE (1<<5)
+       int color_moved_ws_handling;
 };
 
 void diff_emit_submodule_del(struct diff_options *o, const char *line);
@@ -241,7 +253,13 @@ enum color_diff {
        DIFF_FILE_NEW_MOVED = 13,
        DIFF_FILE_NEW_MOVED_ALT = 14,
        DIFF_FILE_NEW_MOVED_DIM = 15,
-       DIFF_FILE_NEW_MOVED_ALT_DIM = 16
+       DIFF_FILE_NEW_MOVED_ALT_DIM = 16,
+       DIFF_CONTEXT_DIM = 17,
+       DIFF_FILE_OLD_DIM = 18,
+       DIFF_FILE_NEW_DIM = 19,
+       DIFF_CONTEXT_BOLD = 20,
+       DIFF_FILE_OLD_BOLD = 21,
+       DIFF_FILE_NEW_BOLD = 22,
 };
 const char *diff_get_color(int diff_use_color, enum color_diff ix);
 #define diff_get_color_opt(o, ix) \
@@ -324,6 +342,7 @@ extern int git_diff_ui_config(const char *var, const char *value, void *cb);
 extern void diff_setup(struct diff_options *);
 extern int diff_opt_parse(struct diff_options *, const char **, int, const char *);
 extern void diff_setup_done(struct diff_options *);
+extern int git_config_rename(const char *var, const char *value);
 
 #define DIFF_DETECT_RENAME     1
 #define DIFF_DETECT_COPY       2