combine-diff: add a bit more comments.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 30, 2006 at 16:34 UTC
b469d8b6f7a8dd90527c43f345a1b5cf2e72f666
1 file changed
+7
-1
combine-diff.c
+7
-1
@@ -68,6 +68,7 @@ static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr,
68
return curr;
69
}
70
71
+/* Lines lost from parent */
72
struct lline {
73
struct lline *next;
74
int len;
@@ -75,10 +76,15 @@ struct lline {
76
char line[FLEX_ARRAY];
77
};
78
79
+/* Lines surviving in the merge result */
80
struct sline {
81
struct lline *lost_head, **lost_tail;
82
char *bol;
83
int len;
84
+ /* bit 0 up to (N-1) are on if the parent does _not_
85
+ * have this line (i.e. we changed it).
86
+ * bit N is used for "interesting" lines, including context.
87
+ */
88
unsigned long flag;
89
};
90
@@ -242,7 +248,7 @@ static void combine_diff(const unsigned char *parent, const char *ourtmp,
248
continue;
249
}
250
if (!lost_bucket)
245
- continue;
251
+ continue; /* not in any hunk yet */
252
switch (line[0]) {
253
case '-':
254
append_lost(lost_bucket, n, line+1);