git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nicolas Pitre <nico@cam.org>
Cc: git@vger.kernel.org
Subject: [PATCH 1/2] xdl_diff: identify call sites.
Date: Thu, 13 Dec 2007 14:31:28 -0800	[thread overview]
Message-ID: <7vtzmmz0ov.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: alpine.LFD.0.99999.0712122219160.20487@xanadu.home

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>
---

 Nicolas Pitre <nico@cam.org> writes:

 > On Wed, 12 Dec 2007, Junio C Hamano wrote:
 >
 >> Here are the topics that have been cooking.
 >
 > What about the blame speedup patch from Linus (Message-ID: 
 > <alpine.LFD.0.9999.0712111548200.25032@woody.linux-foundation.org>)

 I would prefer to do a bit more generic solution, not a special hack for
 speeding up blame on prepend-only files, with a proper log message.

 Here is the first installment of such.

 builtin-blame.c   |    2 +-
 builtin-rerere.c  |    2 +-
 combine-diff.c    |    2 +-
 diff.c            |   10 +++++-----
 merge-file.c      |    2 +-
 merge-tree.c      |    2 +-
 xdiff-interface.c |    5 +++++
 xdiff-interface.h |    1 +
 8 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/builtin-blame.c b/builtin-blame.c
index 5466d01..99ea0a0 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -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;
diff --git a/builtin-rerere.c b/builtin-rerere.c
index 7449323..37e6248 100644
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
@@ -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);
diff --git a/combine-diff.c b/combine-diff.c
index 5a658dc..e22db89 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -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.
diff --git a/diff.c b/diff.c
index 9c79ee2..3dd2f35 100644
--- a/diff.c
+++ b/diff.c
@@ -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);
@@ -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);
 	}
@@ -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:
@@ -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);
@@ -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);
diff --git a/merge-file.c b/merge-file.c
index 1e031ea..2a939c9 100644
--- a/merge-file.c
+++ b/merge-file.c
@@ -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)
diff --git a/merge-tree.c b/merge-tree.c
index 7d4f628..e083246 100644
--- a/merge-tree.c
+++ b/merge-tree.c
@@ -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);
 }
diff --git a/xdiff-interface.c b/xdiff-interface.c
index be866d1..69a022c 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -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;
diff --git a/xdiff-interface.h b/xdiff-interface.h
index fb742db..f7f791d 100644
--- a/xdiff-interface.h
+++ b/xdiff-interface.h
@@ -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,
-- 
1.5.4.rc0.1.g37d0

  reply	other threads:[~2007-12-13 22:32 UTC|newest]

Thread overview: 168+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-22  6:32 What's cooking in git/spearce.git (topics) Shawn O. Pearce
2007-10-22  6:59 ` Jeff King
2007-10-22  7:16 ` Jeff King
2007-10-23  2:32   ` Linus Torvalds
2007-10-23  3:48     ` Jeff King
2007-10-22  7:24 ` Pierre Habouzit
2007-10-22 15:27 ` Steffen Prohaska
2007-10-23  1:26 ` Junio C Hamano
2007-10-23  3:34   ` Shawn O. Pearce
2007-10-24 12:51 ` What's cooking in git.git (topics) Junio C Hamano
2007-10-24 13:09   ` David Symonds
2007-10-24 16:08   ` Scott Parish
2007-10-24 18:27     ` Andreas Ericsson
2007-10-25  0:35       ` Scott Parish
2007-11-01  5:41   ` Junio C Hamano
2007-11-01 11:02     ` Jakub Narebski
2007-11-01 20:57       ` Junio C Hamano
2007-11-01 18:33     ` Linus Torvalds
2007-11-01 19:19       ` Geert Bosch
2007-11-01 20:27         ` Junio C Hamano
2007-11-01 20:47           ` Mike Hommey
2007-11-01 21:20             ` Junio C Hamano
2007-11-02  0:32               ` Junio C Hamano
2007-11-01 21:44             ` Pierre Habouzit
2007-11-01 21:17           ` Geert Bosch
2007-11-02  0:00             ` Jonas Fonseca
2007-11-01 21:18           ` Theodore Tso
2007-11-01 21:26             ` Melchior FRANZ
2007-11-01 21:32           ` Johan Herland
2007-11-01 21:51             ` Junio C Hamano
2007-11-01 22:05               ` Linus Torvalds
2007-11-01 22:26                 ` Bill Lear
2007-11-01 22:50                 ` Junio C Hamano
2007-11-02  2:19                 ` Petr Baudis
2007-11-01 21:42           ` Pierre Habouzit
2007-11-02  9:39             ` Andreas Ericsson
2007-11-01 21:57       ` Pierre Habouzit
2007-11-02  0:04       ` Jakub Narebski
2007-11-02  2:23         ` Petr Baudis
2007-11-02  7:25           ` Jakub Narebski
2007-11-02  7:28             ` Jakub Narebski
2007-11-02  8:42               ` Pierre Habouzit
2007-11-02  6:06       ` Miles Bader
2007-11-02 15:13         ` Miles Bader
2007-11-02  9:38       ` Andreas Ericsson
2007-11-02 11:03         ` Johannes Schindelin
2007-11-01 21:41     ` Brian Downing
2007-11-01 21:46       ` Pierre Habouzit
2007-11-02 10:26       ` Wincent Colaiuta
2007-11-04  4:14     ` Junio C Hamano
2007-11-04  9:43       ` Jakub Narebski
2007-11-04 11:38       ` Pierre Habouzit
2007-11-08  8:08       ` Junio C Hamano
2007-11-08 20:44         ` Steffen Prohaska
2007-11-12  7:09         ` Junio C Hamano
2007-11-12 12:21           ` Johannes Schindelin
2007-11-12 12:26             ` Pierre Habouzit
2007-11-12 12:33               ` Johannes Schindelin
2007-11-12 13:11                 ` [PATCH] rebase: brown paper bag fix after the detached HEAD patch Johannes Schindelin
2007-11-12 14:53                 ` What's cooking in git.git (topics) Pierre Habouzit
2007-11-12 14:27             ` Steffen Prohaska
2007-11-12 15:02               ` Johannes Schindelin
2007-11-18 16:13                 ` [PATCH 1/2] push: Add '--matching' option and print warning if it should be used Steffen Prohaska
2007-11-18 16:13                   ` [PATCH 2/2] push: Add '--current', which pushes only the current branch Steffen Prohaska
2007-11-19  1:28                     ` Junio C Hamano
2007-11-19  6:41                       ` Steffen Prohaska
2007-11-19  7:27                         ` Junio C Hamano
2007-11-19  7:50                           ` Junio C Hamano
2007-11-19  9:27                             ` Andreas Ericsson
2007-11-19  8:17                           ` Steffen Prohaska
2007-11-19  8:35                             ` Junio C Hamano
2007-11-19  9:54                               ` Steffen Prohaska
2007-11-19 16:51                                 ` [PATCH] push: Add "--current", " Steffen Prohaska
2007-11-19 11:17                               ` [PATCH 2/2] push: Add '--current', " Jakub Narebski
2007-11-19 19:57                                 ` Junio C Hamano
2007-11-19 21:04                                   ` Jakub Narebski
2007-11-19 22:15                                     ` Junio C Hamano
2007-11-19 22:29                                       ` Jakub Narebski
2007-11-19  9:24                         ` Andreas Ericsson
2007-11-12 15:15           ` [PATCH] git-commit: Add tests for invalid usage of -a/--interactive with paths Björn Steinbrink
2007-11-15  0:18           ` What's cooking in git.git (topics) Junio C Hamano
2007-11-15  0:49             ` Johannes Schindelin
2007-11-15 14:49               ` [PATCH] t7501-commit: Add test for git commit <file> with dirty index Kristian Høgsberg
2007-11-15 15:55                 ` Johannes Schindelin
2007-11-15 16:11                 ` [PATCH] builtin-commit: fix "git add x y && git commit y" committing x, too Johannes Schindelin
2007-11-15 16:37                   ` Johannes Schindelin
2007-11-15 17:01                   ` Kristian Høgsberg
2007-11-16  0:43                     ` Johannes Schindelin
2007-11-17  8:45                       ` Junio C Hamano
2007-11-18  9:18                         ` Junio C Hamano
2007-11-17 12:40             ` What's cooking in git.git (topics) Jeff King
2007-11-17 20:51             ` Junio C Hamano
2007-11-17 23:42               ` Alex Riesen
2007-11-18  1:29                 ` Junio C Hamano
2007-11-21  9:23               ` Junio C Hamano
2007-11-23  8:48                 ` Junio C Hamano
2007-11-23 10:30                   ` Jeff King
2007-11-23 13:23                     ` Johannes Schindelin
2007-11-24 11:38                       ` Jeff King
2007-11-24 15:47                         ` Nicolas Pitre
2007-11-24 19:09                           ` Junio C Hamano
2007-11-25 21:51                             ` J. Bruce Fields
2007-11-25 22:42                               ` Junio C Hamano
2007-11-25 23:08                                 ` J. Bruce Fields
2007-11-26  4:02                               ` Nicolas Pitre
2007-11-26  4:15                                 ` J. Bruce Fields
2007-11-26  4:29                                   ` Nicolas Pitre
2007-11-26  4:45                                     ` J. Bruce Fields
2007-11-26  9:03                                     ` Jakub Narebski
2007-11-26  9:09                                       ` Andreas Ericsson
2007-11-26 19:11                                       ` Nicolas Pitre
2007-11-26 19:24                                         ` David Kastrup
2007-11-26 20:25                                           ` Nicolas Pitre
2007-11-26 20:40                                             ` Junio C Hamano
2007-11-26 20:45                                             ` David Kastrup
2007-11-26 21:09                                               ` Nicolas Pitre
2007-11-26 21:22                                                 ` David Kastrup
2007-11-26 22:02                                                   ` Nicolas Pitre
2007-11-26 23:05                                                     ` David Kastrup
2007-11-26 23:28                                                       ` Nicolas Pitre
2007-11-26 23:52                                                         ` David Kastrup
2007-11-27  4:05                                                           ` Nicolas Pitre
2007-12-05 21:58                                                 ` Miles Bader
2007-11-26 21:14                                             ` Jakub Narebski
2007-11-26 21:36                                               ` Johannes Schindelin
2007-11-26 21:47                                                 ` Nicolas Pitre
2007-11-26  6:15                                   ` Jan Hudec
2007-11-25 20:27                   ` Junio C Hamano
2007-11-25 20:36                     ` Jakub Narebski
2007-11-25 20:53                       ` J. Bruce Fields
2007-12-01  2:37                     ` Junio C Hamano
2007-12-01  8:55                       ` Eric Wong
2007-12-02 14:14                       ` [PATCH, next version] Add 'git fast-export', the sister of 'git fast-import' Johannes Schindelin
2007-12-02 14:40                       ` What's cooking in git.git (topics) Johannes Schindelin
2007-12-04  8:43                       ` Junio C Hamano
2007-12-04  9:40                         ` Johannes Sixt
2007-12-04 10:08                           ` msysGit on FAT32 (was: What's cooking in git.git (topics)) Jakub Narebski
2007-12-04 13:30                             ` Johannes Schindelin
2007-12-04 13:48                               ` msysGit on FAT32 Johannes Sixt
2007-12-04 14:37                                 ` Johannes Schindelin
2007-12-04 20:03                           ` What's cooking in git.git (topics) Steffen Prohaska
2007-12-05 10:59                         ` Junio C Hamano
2007-12-05 11:08                           ` Jakub Narebski
2007-12-05 11:10                           ` Jakub Narebski
2007-12-06  4:43                             ` Jeff King
2007-12-05 11:37                           ` [PATCH] Soft aliases: add "less" and minimal documentation Johannes Schindelin
2007-12-05 19:45                             ` Junio C Hamano
2007-12-06  4:50                               ` Jeff King
2007-12-06  4:32                           ` What's cooking in git.git (topics) Jeff King
2007-12-07  9:51                           ` Junio C Hamano
2007-12-07 11:11                             ` Jakub Narebski
2007-12-07 19:29                               ` Junio C Hamano
2007-12-07 21:36                             ` Miklos Vajna
2007-12-09 10:27                             ` Junio C Hamano
2007-12-13  2:48                               ` Junio C Hamano
2007-12-13  3:22                                 ` Nicolas Pitre
2007-12-13 22:31                                   ` Junio C Hamano [this message]
2007-12-14  7:03                                     ` [PATCH 1/2] xdl_diff: identify call sites Junio C Hamano
2007-12-13 22:31                                   ` [PATCH 2/2] xdi_diff: trim common trailing lines Junio C Hamano
2007-12-14  9:06                                     ` Peter Baumann
2007-12-14 19:15                                       ` Junio C Hamano
2007-12-17  8:40                                 ` What's cooking in git.git (topics) Junio C Hamano
2007-12-23  9:20                                   ` Junio C Hamano
2007-12-31 10:47                                     ` checkout --push/--pop idea (Re: What's cooking in git.git (topics)) Jan Hudec
2008-01-05 11:01                                     ` What's cooking in git.git (topics) Junio C Hamano
2008-01-05 16:04                                       ` Johannes Schindelin
2008-01-22  8:47                                       ` What will be cooking in git.git post 1.5.4 (topics) Junio C Hamano
2007-12-04 16:18                       ` What's cooking in git.git (topics) Brian Downing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vtzmmz0ov.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=nico@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).