--- OLD/diff.c Thu Jan 1 00:00:00 1970 +++ NEW/diff.c Thu Jan 1 00:00:00 1970 @@ -881,7 +881,7 @@ int max_change = 0, max_len = 0; int total_files = data->nr; int width, name_width; - const char *reset, *set, *add_c, *del_c; + const char *reset, *add_c, *del_c; if (data->nr == 0) return; @@ -901,7 +901,6 @@ /* Find the longest filename and max number of changes */ reset = diff_get_color_opt(options, DIFF_RESET); - set = diff_get_color_opt(options, DIFF_PLAIN); add_c = diff_get_color_opt(options, DIFF_FILE_NEW); del_c = diff_get_color_opt(options, DIFF_FILE_OLD); @@ -1566,7 +1565,8 @@ xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts; xecfg.ctxlen = o->context; xecfg.interhunkctxlen = o->interhunkcontext; - xecfg.flags = XDL_EMIT_FUNCNAMES; + xecfg.flags = 0; + if (o->funcnames) xecfg.flags |= XDL_EMIT_FUNCNAMES; if (pe) xdiff_set_find_func(&xecfg, pe->pattern, pe->cflags); if (!diffopts) @@ -2356,6 +2356,7 @@ if (diff_use_color_default > 0) DIFF_OPT_SET(options, COLOR_DIFF); options->detect_rename = diff_detect_rename_default; + options->funcnames = 1; if (!diff_mnemonic_prefix) { options->a_prefix = "a/"; @@ -2656,14 +2657,17 @@ options->orderfile = arg + 2; else if (!prefixcmp(arg, "--diff-filter=")) options->filter = arg + 14; - else if (!strcmp(arg, "--abbrev")) + else if (!strcmp(arg, "--abbrev")) { options->abbrev = DEFAULT_ABBREV; + abbrev_length = DEFAULT_ABBREV; + } else if (!prefixcmp(arg, "--abbrev=")) { options->abbrev = strtoul(arg + 9, NULL, 10); if (options->abbrev < MINIMUM_ABBREV) options->abbrev = MINIMUM_ABBREV; else if (40 < options->abbrev) options->abbrev = 40; + abbrev_length = options->abbrev; } else if (!prefixcmp(arg, "--src-prefix=")) options->a_prefix = arg + 13; @@ -2671,6 +2675,10 @@ options->b_prefix = arg + 13; else if (!strcmp(arg, "--no-prefix")) options->a_prefix = options->b_prefix = ""; + else if (!strcmp(arg, "--funcnames")) + options->funcnames = 1; + else if (!strcmp(arg, "--no-funcnames")) + options->funcnames = 0; else if (opt_arg(arg, '\0', "inter-hunk-context", &options->interhunkcontext)) ; @@ -3201,7 +3209,8 @@ xpp.flags = XDF_NEED_MINIMAL; xecfg.ctxlen = 3; - xecfg.flags = XDL_EMIT_FUNCNAMES; + xecfg.flags = 0; + if (options->funcnames) xecfg.flags |= XDL_EMIT_FUNCNAMES; xdi_diff_outf(&mf1, &mf2, patch_id_consume, &data, &xpp, &xecfg, &ecb); }