Skip to content
Newer
Older
100644 134 lines (113 sloc) 4.4 KB
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
1 /*
2 * Copyright (C) 2005 Junio C Hamano
3 */
e0173ad Make macros to prevent double-inclusion in headers consistent.
Junio C Hamano authored Apr 28, 2007
4 #ifndef DIFFCORE_H
5 #define DIFFCORE_H
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
6
7 /* This header file is internal between diff.c and its diff transformers
8 * (e.g. diffcore-rename, diffcore-pickaxe). Never include this header
9 * in anything else.
10 */
eeaa460 [PATCH] diff: Update -B heuristics.
Junio C Hamano authored Jun 3, 2005
11
12 /* We internally use unsigned short as the score value,
13 * and rely on an int capable to hold 32-bits. -B can take
14 * -Bmerge_score/break_score format and the two scores are
15 * passed around in one int (high 16-bit for merge and low 16-bit
16 * for break).
17 */
ee3d299 diffcore-break/diffcore-rename: integer overflow.
Junio C Hamano authored Jan 15, 2006
18 #define MAX_SCORE 60000.0
f345b0a [PATCH] Add -B flag to diff-* brothers.
Junio C Hamano authored May 30, 2005
19 #define DEFAULT_RENAME_SCORE 30000 /* rename/copy similarity minimum (50%) */
4d0f39c diffcore-break: similarity estimator fix.
Junio C Hamano authored Mar 4, 2006
20 #define DEFAULT_BREAK_SCORE 30000 /* minimum for break to happen (50%) */
cf958af @moy Document -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -C
moy authored Aug 5, 2010
21 #define DEFAULT_MERGE_SCORE 36000 /* maximum for break-merge to happen (60%) */
eeaa460 [PATCH] diff: Update -B heuristics.
Junio C Hamano authored Jun 3, 2005
22
23 #define MINIMUM_BREAK_SIZE 400 /* do not break a file smaller than this */
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
24
122aa6f @peff diff: introduce diff.<driver>.binary
peff authored Oct 5, 2008
25 struct userdiff_driver;
26
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
27 struct diff_filespec {
28 unsigned char sha1[20];
29 char *path;
30 void *data;
c06c796 diffcore-rename: somewhat optimized.
Junio C Hamano authored Mar 12, 2006
31 void *cnt_data;
e0e324a @gitster Fix configuration syntax to specify customized hunk header patterns.
gitster authored Jul 7, 2007
32 const char *funcname_pattern_ident;
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
33 unsigned long size;
9fb8841 @torvalds Ref-count the filespecs used by diffcore
torvalds authored Oct 25, 2007
34 int count; /* Reference count */
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
35 int xfrm_flags; /* for use by the xfrm */
6447971 @torvalds copy vs rename detection: avoid unnecessary O(n*m) loops
torvalds authored Oct 25, 2007
36 int rename_used; /* Count of rename users */
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
37 unsigned short mode; /* file mode */
38 unsigned sha1_valid : 1; /* if true, use sha1 and trust mode;
39 * if false, use the name and read from
40 * the filesystem.
41 */
dc7090e [PATCH] Re-Fix SIGSEGV on unmerged files in git-diff-files -p
Junio C Hamano authored Jun 12, 2005
42 #define DIFF_FILE_VALID(spec) (((spec)->mode) != 0)
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
43 unsigned should_free : 1; /* data should be free()'ed */
44 unsigned should_munmap : 1; /* data should be munmap()'ed */
c7e1a73 @jlehmann git diff --submodule: Show detailed dirty status of submodules
jlehmann authored Mar 4, 2010
45 unsigned dirty_submodule : 2; /* For submodules: its work tree is dirty */
4682d85 @gitster diff-index.c: "git diff" has no need to read blob from the standard i…
gitster authored Jun 27, 2012
46 unsigned is_stdin : 1;
c7e1a73 @jlehmann git diff --submodule: Show detailed dirty status of submodules
jlehmann authored Mar 4, 2010
47 #define DIRTY_SUBMODULE_UNTRACKED 1
48 #define DIRTY_SUBMODULE_MODIFIED 2
25e5e2b @gitster combine-diff: support format_callback
gitster authored Aug 19, 2011
49 unsigned has_more_entries : 1; /* only appear in combined diff */
122aa6f @peff diff: introduce diff.<driver>.binary
peff authored Oct 5, 2008
50 struct userdiff_driver *driver;
51 /* data should be considered "binary"; -1 means "don't know yet" */
52 int is_binary;
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
53 };
54
55 extern struct diff_filespec *alloc_filespec(const char *);
9fb8841 @torvalds Ref-count the filespecs used by diffcore
torvalds authored Oct 25, 2007
56 extern void free_filespec(struct diff_filespec *);
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
57 extern void fill_filespec(struct diff_filespec *, const unsigned char *,
e545010 @peff diff: do not use null sha1 as a sentinel value
peff authored Jul 28, 2012
58 int, unsigned short);
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
59
f0c6b2a [PATCH] Optimize diff-tree -[CM] --stdin
Junio C Hamano authored May 27, 2005
60 extern int diff_populate_filespec(struct diff_filespec *, int);
19397b4 Revert "[PATCH] plug memory leak in diff.c::diff_free_filepair()"
Junio C Hamano authored Sep 14, 2005
61 extern void diff_free_filespec_data(struct diff_filespec *);
8ae92e6 @gitster rename diff_free_filespec_data_large() to diff_free_filespec_blob()
gitster authored Oct 2, 2007
62 extern void diff_free_filespec_blob(struct diff_filespec *);
29a3eef @gitster Introduce diff_filespec_is_binary()
gitster authored Jul 6, 2007
63 extern int diff_filespec_is_binary(struct diff_filespec *);
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
64
52e9578 [PATCH] Introducing software archaeologist's tool "pickaxe".
Junio C Hamano authored May 21, 2005
65 struct diff_filepair {
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
66 struct diff_filespec *one;
67 struct diff_filespec *two;
01c4e70 [PATCH] diff: code clean-up and removal of rename hack.
Junio C Hamano authored May 29, 2005
68 unsigned short int score;
a5a323f @ydirson Add reference for status letters in documentation.
ydirson authored Nov 2, 2008
69 char status; /* M C R A D U etc. (see Documentation/diff-format.txt or DIFF_STATUS_* in diff.h) */
f345b0a [PATCH] Add -B flag to diff-* brothers.
Junio C Hamano authored May 30, 2005
70 unsigned broken_pair : 1;
ef67768 diff.c: do not use pathname comparison to tell renames
Junio C Hamano authored Aug 3, 2006
71 unsigned renamed_pair : 1;
e9c8409 diff-index --cached --raw: show tree entry on the LHS for unmerged en…
Junio C Hamano authored Jan 5, 2007
72 unsigned is_unmerged : 1;
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
73 };
e9c8409 diff-index --cached --raw: show tree entry on the LHS for unmerged en…
Junio C Hamano authored Jan 5, 2007
74 #define DIFF_PAIR_UNMERGED(p) ((p)->is_unmerged)
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
75
ef67768 diff.c: do not use pathname comparison to tell renames
Junio C Hamano authored Aug 3, 2006
76 #define DIFF_PAIR_RENAME(p) ((p)->renamed_pair)
01c4e70 [PATCH] diff: code clean-up and removal of rename hack.
Junio C Hamano authored May 29, 2005
77
f345b0a [PATCH] Add -B flag to diff-* brothers.
Junio C Hamano authored May 30, 2005
78 #define DIFF_PAIR_BROKEN(p) \
79 ( (!DIFF_FILE_VALID((p)->one) != !DIFF_FILE_VALID((p)->two)) && \
80 ((p)->broken_pair != 0) )
81
96716a1 [PATCH] Fix type-change handling when assigning the status code to fi…
Junio C Hamano authored May 25, 2005
82 #define DIFF_PAIR_TYPE_CHANGED(p) \
83 ((S_IFMT & (p)->one->mode) != (S_IFMT & (p)->two->mode))
84
4130b99 [PATCH] Diff updates to express type changes
Junio C Hamano authored May 26, 2005
85 #define DIFF_PAIR_MODE_CHANGED(p) ((p)->one->mode != (p)->two->mode)
86
226406f [PATCH] Introduce diff_free_filepair() funcion.
Junio C Hamano authored May 27, 2005
87 extern void diff_free_filepair(struct diff_filepair *);
88
f7c1512 [PATCH] Rename/copy detection fix.
Junio C Hamano authored May 22, 2005
89 extern int diff_unmodified_pair(struct diff_filepair *);
90
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
91 struct diff_queue_struct {
52e9578 [PATCH] Introducing software archaeologist's tool "pickaxe".
Junio C Hamano authored May 21, 2005
92 struct diff_filepair **queue;
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
93 int alloc;
94 int nr;
95 };
9ca5df9 @byang Add a macro DIFF_QUEUE_CLEAR.
byang authored May 6, 2010
96 #define DIFF_QUEUE_CLEAR(q) \
97 do { \
98 (q)->queue = NULL; \
99 (q)->nr = (q)->alloc = 0; \
9874606 @jrn Standardize do { ... } while (0) style
jrn authored Aug 12, 2010
100 } while (0)
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
101
38c6f78 [PATCH] Prepare diffcore interface for diff-tree header supression.
Junio C Hamano authored May 21, 2005
102 extern struct diff_queue_struct diff_queued_diff;
52e9578 [PATCH] Introducing software archaeologist's tool "pickaxe".
Junio C Hamano authored May 21, 2005
103 extern struct diff_filepair *diff_queue(struct diff_queue_struct *,
104 struct diff_filespec *,
105 struct diff_filespec *);
6b14d7f [PATCH] Diffcore updates.
Junio C Hamano authored May 22, 2005
106 extern void diff_q(struct diff_queue_struct *, struct diff_filepair *);
f7c1512 [PATCH] Rename/copy detection fix.
Junio C Hamano authored May 23, 2005
107
ce24067 [PATCH] diff: Fix docs and add -O to diff-helper.
Junio C Hamano authored Jun 3, 2005
108 extern void diffcore_break(int);
8082d8d Diff: -l<num> to limit rename/copy detection.
Junio C Hamano authored Sep 21, 2005
109 extern void diffcore_rename(struct diff_options *);
eeaa460 [PATCH] diff: Update -B heuristics.
Junio C Hamano authored Jun 3, 2005
110 extern void diffcore_merge_broken(void);
382f013 @gitster diff: pass the entire diff-options to diffcore_pickaxe()
gitster authored Aug 31, 2010
111 extern void diffcore_pickaxe(struct diff_options *);
ce24067 [PATCH] diff: Fix docs and add -O to diff-helper.
Junio C Hamano authored Jun 3, 2005
112 extern void diffcore_order(const char *orderfile);
113
25d5ea4 [PATCH] Redo rename/copy detection logic.
Junio C Hamano authored May 24, 2005
114 #define DIFF_DEBUG 0
115 #if DIFF_DEBUG
116 void diff_debug_filespec(struct diff_filespec *, int, const char *);
117 void diff_debug_filepair(const struct diff_filepair *, int);
118 void diff_debug_queue(const char *, struct diff_queue_struct *);
119 #else
9874606 @jrn Standardize do { ... } while (0) style
jrn authored Aug 12, 2010
120 #define diff_debug_filespec(a,b,c) do { /* nothing */ } while (0)
121 #define diff_debug_filepair(a,b) do { /* nothing */ } while (0)
122 #define diff_debug_queue(a,b) do { /* nothing */ } while (0)
25d5ea4 [PATCH] Redo rename/copy detection logic.
Junio C Hamano authored May 24, 2005
123 #endif
124
d8c3d03 @gitster diffcore_count_changes: pass diffcore_filespec
gitster authored Jun 28, 2007
125 extern int diffcore_count_changes(struct diff_filespec *src,
126 struct diff_filespec *dst,
c06c796 diffcore-rename: somewhat optimized.
Junio C Hamano authored Mar 12, 2006
127 void **src_count_p,
128 void **dst_count_p,
6541675 diffcore-rename: split out the delta counting code.
Junio C Hamano authored Feb 28, 2006
129 unsigned long delta_limit,
130 unsigned long *src_copied,
131 unsigned long *literal_added);
132
427dcb4 [PATCH] Diff overhaul, adding half of copy detection.
Junio C Hamano authored May 21, 2005
133 #endif
Something went wrong with that request. Please try again.