Merge branch 'rs/diff-no-minimal'
* rs/diff-no-minimal: git diff too slow for a file
This commit is contained in:
commit
39b5977b13
@ -39,7 +39,7 @@ static int show_root;
|
|||||||
static int reverse;
|
static int reverse;
|
||||||
static int blank_boundary;
|
static int blank_boundary;
|
||||||
static int incremental;
|
static int incremental;
|
||||||
static int xdl_opts = XDF_NEED_MINIMAL;
|
static int xdl_opts;
|
||||||
|
|
||||||
static enum date_mode blame_date_mode = DATE_ISO8601;
|
static enum date_mode blame_date_mode = DATE_ISO8601;
|
||||||
static size_t blame_date_width;
|
static size_t blame_date_width;
|
||||||
|
@ -25,7 +25,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
|
|||||||
const char *names[3] = { NULL, NULL, NULL };
|
const char *names[3] = { NULL, NULL, NULL };
|
||||||
mmfile_t mmfs[3];
|
mmfile_t mmfs[3];
|
||||||
mmbuffer_t result = {NULL, 0};
|
mmbuffer_t result = {NULL, 0};
|
||||||
xmparam_t xmp = {{XDF_NEED_MINIMAL}};
|
xmparam_t xmp = {{0}};
|
||||||
int ret = 0, i = 0, to_stdout = 0;
|
int ret = 0, i = 0, to_stdout = 0;
|
||||||
int quiet = 0;
|
int quiet = 0;
|
||||||
int nongit;
|
int nongit;
|
||||||
|
@ -106,7 +106,7 @@ static void show_diff(struct merge_list *entry)
|
|||||||
xdemitconf_t xecfg;
|
xdemitconf_t xecfg;
|
||||||
xdemitcb_t ecb;
|
xdemitcb_t ecb;
|
||||||
|
|
||||||
xpp.flags = XDF_NEED_MINIMAL;
|
xpp.flags = 0;
|
||||||
memset(&xecfg, 0, sizeof(xecfg));
|
memset(&xecfg, 0, sizeof(xecfg));
|
||||||
xecfg.ctxlen = 3;
|
xecfg.ctxlen = 3;
|
||||||
ecb.outf = show_outf;
|
ecb.outf = show_outf;
|
||||||
|
@ -89,7 +89,7 @@ static int diff_two(const char *file1, const char *label1,
|
|||||||
printf("--- a/%s\n+++ b/%s\n", label1, label2);
|
printf("--- a/%s\n+++ b/%s\n", label1, label2);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
memset(&xpp, 0, sizeof(xpp));
|
memset(&xpp, 0, sizeof(xpp));
|
||||||
xpp.flags = XDF_NEED_MINIMAL;
|
xpp.flags = 0;
|
||||||
memset(&xecfg, 0, sizeof(xecfg));
|
memset(&xecfg, 0, sizeof(xecfg));
|
||||||
xecfg.ctxlen = 3;
|
xecfg.ctxlen = 3;
|
||||||
ecb.outf = outf;
|
ecb.outf = outf;
|
||||||
|
@ -220,7 +220,7 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,
|
|||||||
parent_file.ptr = grab_blob(parent, mode, &sz);
|
parent_file.ptr = grab_blob(parent, mode, &sz);
|
||||||
parent_file.size = sz;
|
parent_file.size = sz;
|
||||||
memset(&xpp, 0, sizeof(xpp));
|
memset(&xpp, 0, sizeof(xpp));
|
||||||
xpp.flags = XDF_NEED_MINIMAL;
|
xpp.flags = 0;
|
||||||
memset(&xecfg, 0, sizeof(xecfg));
|
memset(&xecfg, 0, sizeof(xecfg));
|
||||||
memset(&state, 0, sizeof(state));
|
memset(&state, 0, sizeof(state));
|
||||||
state.nmask = nmask;
|
state.nmask = nmask;
|
||||||
|
10
diff.c
10
diff.c
@ -754,7 +754,7 @@ static void diff_words_show(struct diff_words_data *diff_words)
|
|||||||
memset(&xecfg, 0, sizeof(xecfg));
|
memset(&xecfg, 0, sizeof(xecfg));
|
||||||
diff_words_fill(&diff_words->minus, &minus, diff_words->word_regex);
|
diff_words_fill(&diff_words->minus, &minus, diff_words->word_regex);
|
||||||
diff_words_fill(&diff_words->plus, &plus, diff_words->word_regex);
|
diff_words_fill(&diff_words->plus, &plus, diff_words->word_regex);
|
||||||
xpp.flags = XDF_NEED_MINIMAL;
|
xpp.flags = 0;
|
||||||
/* as only the hunk header will be parsed, we need a 0-context */
|
/* as only the hunk header will be parsed, we need a 0-context */
|
||||||
xecfg.ctxlen = 0;
|
xecfg.ctxlen = 0;
|
||||||
xdi_diff_outf(&minus, &plus, fn_out_diff_words_aux, diff_words,
|
xdi_diff_outf(&minus, &plus, fn_out_diff_words_aux, diff_words,
|
||||||
@ -1789,7 +1789,7 @@ static void builtin_diff(const char *name_a,
|
|||||||
check_blank_at_eof(&mf1, &mf2, &ecbdata);
|
check_blank_at_eof(&mf1, &mf2, &ecbdata);
|
||||||
ecbdata.file = o->file;
|
ecbdata.file = o->file;
|
||||||
ecbdata.header = header.len ? &header : NULL;
|
ecbdata.header = header.len ? &header : NULL;
|
||||||
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
|
xpp.flags = o->xdl_opts;
|
||||||
xecfg.ctxlen = o->context;
|
xecfg.ctxlen = o->context;
|
||||||
xecfg.interhunkctxlen = o->interhunkcontext;
|
xecfg.interhunkctxlen = o->interhunkcontext;
|
||||||
xecfg.flags = XDL_EMIT_FUNCNAMES;
|
xecfg.flags = XDL_EMIT_FUNCNAMES;
|
||||||
@ -1894,7 +1894,7 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
|
|||||||
|
|
||||||
memset(&xpp, 0, sizeof(xpp));
|
memset(&xpp, 0, sizeof(xpp));
|
||||||
memset(&xecfg, 0, sizeof(xecfg));
|
memset(&xecfg, 0, sizeof(xecfg));
|
||||||
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
|
xpp.flags = o->xdl_opts;
|
||||||
xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
|
xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
|
||||||
&xpp, &xecfg);
|
&xpp, &xecfg);
|
||||||
}
|
}
|
||||||
@ -1942,7 +1942,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
|
|||||||
memset(&xpp, 0, sizeof(xpp));
|
memset(&xpp, 0, sizeof(xpp));
|
||||||
memset(&xecfg, 0, sizeof(xecfg));
|
memset(&xecfg, 0, sizeof(xecfg));
|
||||||
xecfg.ctxlen = 1; /* at least one context line */
|
xecfg.ctxlen = 1; /* at least one context line */
|
||||||
xpp.flags = XDF_NEED_MINIMAL;
|
xpp.flags = 0;
|
||||||
xdi_diff_outf(&mf1, &mf2, checkdiff_consume, &data,
|
xdi_diff_outf(&mf1, &mf2, checkdiff_consume, &data,
|
||||||
&xpp, &xecfg);
|
&xpp, &xecfg);
|
||||||
|
|
||||||
@ -3521,7 +3521,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
|
|||||||
len2, p->two->path);
|
len2, p->two->path);
|
||||||
git_SHA1_Update(&ctx, buffer, len1);
|
git_SHA1_Update(&ctx, buffer, len1);
|
||||||
|
|
||||||
xpp.flags = XDF_NEED_MINIMAL;
|
xpp.flags = 0;
|
||||||
xecfg.ctxlen = 3;
|
xecfg.ctxlen = 3;
|
||||||
xecfg.flags = XDL_EMIT_FUNCNAMES;
|
xecfg.flags = XDL_EMIT_FUNCNAMES;
|
||||||
xdi_diff_outf(&mf1, &mf2, patch_id_consume, &data,
|
xdi_diff_outf(&mf1, &mf2, patch_id_consume, &data,
|
||||||
|
@ -66,7 +66,7 @@ static int generate_common_file(mmfile_t *res, mmfile_t *f1, mmfile_t *f2)
|
|||||||
xdemitcb_t ecb;
|
xdemitcb_t ecb;
|
||||||
|
|
||||||
memset(&xpp, 0, sizeof(xpp));
|
memset(&xpp, 0, sizeof(xpp));
|
||||||
xpp.flags = XDF_NEED_MINIMAL;
|
xpp.flags = 0;
|
||||||
memset(&xecfg, 0, sizeof(xecfg));
|
memset(&xecfg, 0, sizeof(xecfg));
|
||||||
xecfg.ctxlen = 3;
|
xecfg.ctxlen = 3;
|
||||||
xecfg.flags = XDL_EMIT_COMMON;
|
xecfg.flags = XDL_EMIT_COMMON;
|
||||||
|
Loading…
Reference in New Issue
Block a user