Skip to content

Commit

Permalink
xdl_diff: identify call sites.
Browse files Browse the repository at this point in the history
This inserts a new function xdi_diff() that currently does not
do anything other than calling the underlying xdl_diff() to the
callchain of current callers of xdl_diff() function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Dec 14, 2007
1 parent 792c158 commit c279d7e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion builtin-blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static struct patch *compare_buffer(mmfile_t *file_p, mmfile_t *file_o,
state.ret->chunks = NULL;
state.ret->num = 0;

xdl_diff(file_p, file_o, &xpp, &xecfg, &ecb);
xdi_diff(file_p, file_o, &xpp, &xecfg, &ecb);

if (state.ret->num) {
struct chunk *chunk;
Expand Down
2 changes: 1 addition & 1 deletion builtin-rerere.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static int diff_two(const char *file1, const char *label1,
memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = 3;
ecb.outf = outf;
xdl_diff(&minus, &plus, &xpp, &xecfg, &ecb);
xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);

free(minus.ptr);
free(plus.ptr);
Expand Down
2 changes: 1 addition & 1 deletion combine-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static void combine_diff(const unsigned char *parent, mmfile_t *result_file,
state.num_parent = num_parent;
state.n = n;

xdl_diff(&parent_file, result_file, &xpp, &xecfg, &ecb);
xdi_diff(&parent_file, result_file, &xpp, &xecfg, &ecb);
free(parent_file.ptr);

/* Assign line numbers for this parent.
Expand Down
10 changes: 5 additions & 5 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ static void diff_words_show(struct diff_words_data *diff_words)
ecb.outf = xdiff_outf;
ecb.priv = diff_words;
diff_words->xm.consume = fn_out_diff_words_aux;
xdl_diff(&minus, &plus, &xpp, &xecfg, &ecb);
xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);

free(minus.ptr);
free(plus.ptr);
Expand Down Expand Up @@ -1393,7 +1393,7 @@ static void builtin_diff(const char *name_a,
if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
ecbdata.diff_words =
xcalloc(1, sizeof(struct diff_words_data));
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
free_diff_words_data(&ecbdata);
}
Expand Down Expand Up @@ -1446,7 +1446,7 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
ecb.outf = xdiff_outf;
ecb.priv = diffstat;
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
}

free_and_return:
Expand Down Expand Up @@ -1486,7 +1486,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
xpp.flags = XDF_NEED_MINIMAL;
ecb.outf = xdiff_outf;
ecb.priv = &data;
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
}
free_and_return:
diff_free_filespec_data(one);
Expand Down Expand Up @@ -2898,7 +2898,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
xecfg.flags = XDL_EMIT_FUNCNAMES;
ecb.outf = xdiff_outf;
ecb.priv = &data;
xdl_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
}

SHA1_Final(sha1, &ctx);
Expand Down
2 changes: 1 addition & 1 deletion merge-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static int generate_common_file(mmfile_t *res, mmfile_t *f1, mmfile_t *f2)
res->size = 0;

ecb.priv = res;
return xdl_diff(f1, f2, &xpp, &xecfg, &ecb);
return xdi_diff(f1, f2, &xpp, &xecfg, &ecb);
}

void *merge_file(struct blob *base, struct blob *our, struct blob *their, unsigned long *size)
Expand Down
2 changes: 1 addition & 1 deletion merge-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void show_diff(struct merge_list *entry)
if (!dst.ptr)
size = 0;
dst.size = size;
xdl_diff(&src, &dst, &xpp, &xecfg, &ecb);
xdi_diff(&src, &dst, &xpp, &xecfg, &ecb);
free(src.ptr);
free(dst.ptr);
}
Expand Down
5 changes: 5 additions & 0 deletions xdiff-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf)
return 0;
}

int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *xecb)
{
return xdl_diff(mf1, mf2, xpp, xecfg, xecb);
}

int read_mmfile(mmfile_t *ptr, const char *filename)
{
struct stat st;
Expand Down
1 change: 1 addition & 0 deletions xdiff-interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct xdiff_emit_state {
unsigned long remainder_size;
};

int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *ecb);
int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf);
int parse_hunk_header(char *line, int len,
int *ob, int *on,
Expand Down

0 comments on commit c279d7e

Please sign in to comment.