blob: 49dfaace4a459762b414f69ec379911c175bd6c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
Use case:
So you have a patch that you want to backport and it's fitting well modulo
offsets. You want convenient, non-tedious way to get perfectly fitting one.
How to achieve it:
$ patch-fix-offsets -p1 wrongoffsets.patch > goodoffsets.patch
Alternatives:
1. apply patch and rediff (possibly changing the format of the patch!)
$ cp -R <project within which to apply the patch>{,.orig}
$ patch -p1 <wrongoffsets.patch
$ diff -urN <project within which to apply the patch>{.orig,} > goodoffsets.patch
TBD: wiggle, merge, ...
Tools included:
fix-offsets: can either change offsets using limited expressions (DSL)
to specify the desired offset changes, or using its own
(and currently limited and buggy) method directly against
the target codebase -- for latter use case please refer to
patch-fix-offsets below
Note: for expression format, see fix-offsets -h
patch-fix-offsets:
will try to apply, in a dry-run manner, the patch and based
on the patch utility feedback (hunk succeeded with offset X)
will produce an offset expression subsequently feeded into
fix-offsets tool
Notable tools (with a bit different intentions, though):
wiggle: http://neil.brown.name/wiggle/
patchutils: https://git.fedorahosted.org/cgit/patchutils.git/
Quilt: http://savannah.nongnu.org/projects/quilt
Please let me know if there are others handy (surely are!) or if there is
something better to solve use case with the as least effort (either manual
or computational like having the whole tree externalized on the filesystem)
as possible.
--
Jan
jpokorn yr edha tc om
|