aboutsummaryrefslogtreecommitdiff
path: root/diffcore.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-19 23:32:51 -0700
committerJunio C Hamano <gitster@pobox.com>2011-08-20 23:03:06 -0700
commit25e5e2bf85c8a2c2c8945935267539940c11020d (patch)
treee5b5899165adae30fe77b27c078f96ab31b67de4 /diffcore.h
parent0906f6e14e6e9df0c4ea4edb08ebe9f5d16c2391 (diff)
downloadgit-25e5e2bf85c8a2c2c8945935267539940c11020d.tar.gz
git-25e5e2bf85c8a2c2c8945935267539940c11020d.tar.xz
combine-diff: support format_callback
This teaches combine-diff machinery to feed a combined merge to a callback function when DIFF_FORMAT_CALLBACK is specified. So far, format callback functions are not used for anything but 2-way diffs. A callback is given a diff_queue_struct, which is an array of diff_filepair. As its name suggests, a diff_filepair is a _pair_ of diff_filespec that represents a single preimage and a single postimage. Since "diff -c" is to compare N parents with a single merge result and filter out any paths whose result match one (or more) of the parent(s), its output has to be able to represent N preimages and 1 postimage. For this reason, a callback function that inspects a diff_filepair that results from this new infrastructure can and is expected to view the preimage side (i.e. pair->one) as an array of diff_filespec. Each element in the array, except for the last one, is marked with "has_more_entries" bit, so that the same callback function can be used for 2-way diffs and combined diffs. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore.h')
-rw-r--r--diffcore.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/diffcore.h b/diffcore.h
index b8f1fdecf..8f32b824c 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -45,7 +45,7 @@ struct diff_filespec {
unsigned dirty_submodule : 2; /* For submodules: its work tree is dirty */
#define DIRTY_SUBMODULE_UNTRACKED 1
#define DIRTY_SUBMODULE_MODIFIED 2
-
+ unsigned has_more_entries : 1; /* only appear in combined diff */
struct userdiff_driver *driver;
/* data should be considered "binary"; -1 means "don't know yet" */
int is_binary;