summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4afbcab)
raw | patch | inline | side by side (parent: 4afbcab)
author | Junio C Hamano <gitster@pobox.com> | |
Thu, 19 Jun 2008 06:59:41 +0000 (23:59 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 19 Jun 2008 06:59:41 +0000 (23:59 -0700) |
When we include a few uninteresting lines before the interesting ones as
context, we are only interested in seeing the surviving lines themselves
and not the deleted lines that are before them. Mark the added leading
context lines in give_context() and not show deleted lines form them.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
context, we are only interested in seeing the surviving lines themselves
and not the deleted lines that are before them. Mark the added leading
context lines in give_context() and not show deleted lines form them.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
combine-diff.c | patch | blob | history |
diff --git a/combine-diff.c b/combine-diff.c
index 0e19cbaacc1099fd69f7f2d9b4a17c94a327baa9..b6af32455c30964516ffd2cc01576bed7d8e98ec 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
/* bit 0 up to (N-1) are on if the parent has this line (i.e.
* we did not change it).
* bit N is used for "interesting" lines, including context.
+ * bit (N+1) is used for "do not show deletion before this".
*/
unsigned long flag;
unsigned long *p_lno;
{
unsigned long all_mask = (1UL<<num_parent) - 1;
unsigned long mark = (1UL<<num_parent);
+ unsigned long no_pre_delete = (2UL<<num_parent);
unsigned long i;
/* Two groups of interesting lines may have a short gap of
/* Paint a few lines before the first interesting line. */
while (j < i)
- sline[j++].flag |= mark;
+ sline[j++].flag |= mark | no_pre_delete;
again:
/* we know up to i is to be included. where does the
int use_color)
{
unsigned long mark = (1UL<<num_parent);
+ unsigned long no_pre_delete = (2UL<<num_parent);
int i;
unsigned long lno = 0;
const char *c_frag = diff_get_color(use_color, DIFF_FRAGINFO);
int j;
unsigned long p_mask;
sl = &sline[lno++];
- ll = sl->lost_head;
+ ll = (sl->flag & no_pre_delete) ? NULL : sl->lost_head;
while (ll) {
fputs(c_old, stdout);
for (j = 0; j < num_parent; j++) {