git-cvsserver: run post-update hook *after* update.
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 9fcde963dbc6b2951ef3c5adca9f8ddb46023b8c..972b3daa6578776ca2f262d8e4d3290bae64e234 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -23,6 +23,7 @@ static int diff_detect_rename_default;
 static int diff_rename_limit_default = 200;
 static int diff_suppress_blank_empty;
 int diff_use_color_default = -1;
+static const char *diff_word_regex_cfg;
 static const char *external_diff_cmd_cfg;
 int diff_auto_refresh_index = 1;
 static int diff_mnemonic_prefix;
@@ -92,6 +93,8 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
        }
        if (!strcmp(var, "diff.external"))
                return git_config_string(&external_diff_cmd_cfg, var, value);
+       if (!strcmp(var, "diff.wordregex"))
+               return git_config_string(&diff_word_regex_cfg, var, value);
 
        return git_diff_basic_config(var, value, cb);
 }
@@ -118,7 +121,9 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
        }
 
        /* like GNU diff's --suppress-blank-empty option  */
-       if (!strcmp(var, "diff.suppress-blank-empty")) {
+       if (!strcmp(var, "diff.suppressblankempty") ||
+                       /* for backwards compatibility */
+                       !strcmp(var, "diff.suppress-blank-empty")) {
                diff_suppress_blank_empty = git_config_bool(var, value);
                return 0;
        }
@@ -1550,6 +1555,8 @@ static void builtin_diff(const char *name_a,
                                o->word_regex = userdiff_word_regex(one);
                        if (!o->word_regex)
                                o->word_regex = userdiff_word_regex(two);
+                       if (!o->word_regex)
+                               o->word_regex = diff_word_regex_cfg;
                        if (o->word_regex) {
                                ecbdata.diff_words->word_regex = (regex_t *)
                                        xmalloc(sizeof(regex_t));
@@ -2548,6 +2555,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
                options->xdl_opts |= XDF_IGNORE_WHITESPACE_CHANGE;
        else if (!strcmp(arg, "--ignore-space-at-eol"))
                options->xdl_opts |= XDF_IGNORE_WHITESPACE_AT_EOL;
+       else if (!strcmp(arg, "--patience"))
+               options->xdl_opts |= XDF_PATIENCE_DIFF;
 
        /* flags options */
        else if (!strcmp(arg, "--binary")) {