]> git.neil.brown.name Git - wiggle.git/commit
diff: make rediffing of patches more precise.
authorNeilBrown <neilb@suse.de>
Wed, 6 Feb 2013 23:38:15 +0000 (10:38 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 6 Feb 2013 23:38:15 +0000 (10:38 +1100)
commitfa03a2a586e3940e3e64894e4d3ba1784a28cdc2
treebe8cb40956344366f19f415a86417c8922023c75
parent7cf2e41e5da0f7c340876519bd72531e79909426
diff: make rediffing of patches more precise.

When wiggle is given a patch, it splits it into a 'before' and an
'after' section and creates a diff between those.
The hunks in the patch are separated by headers and it is assumed that
these headers will line up in the result.

However: if one hunk removes a chunk of test and  another hunk adds
that chunk of text, the chunk may appear more significant than the
hunk headers, so it will line up, and the hunk headers won't
This creates a mess as one of the current tests shows, and as a
newly added test demonstrates quite neatly.

So if we are re-diffing a patch, find the hunk headers and only
diff the bits between them.

This allows the new test to work, and improves the result of the old
test.

Signed-off-by: NeilBrown <neilb@suse.de>
diff.c
tests/linux/md-resync/merge
tests/mdadm/offroot/merge [new file with mode: 0644]
tests/mdadm/offroot/orig [new file with mode: 0644]
tests/mdadm/offroot/patch [new file with mode: 0644]
vpatch.c
wiggle.c
wiggle.h