Last change
on this file since 3 was
3,
checked in by valtob, 15 years ago
|
subversion source 1.6.2 as test
|
File size:
1.1 KB
|
Line | |
---|
1 | " diff-to-logmsg.vim by Ph. Marek <philipp.marek@bmlv.gv.at> |
---|
2 | " |
---|
3 | " Usage is as follows: |
---|
4 | " |
---|
5 | " diff -urp subversion.orig subversion.mine > patch |
---|
6 | " or |
---|
7 | " svn diff --diff-cmd=diff --extensions="-up" [TARGET...] > patch |
---|
8 | " |
---|
9 | " (the -p tells diff to output the function names), then |
---|
10 | " |
---|
11 | " vi patch |
---|
12 | " :source diff_to_logmsg.vim |
---|
13 | " |
---|
14 | " and voila! Just the documentation has to be written. |
---|
15 | " |
---|
16 | " Note from Julian Foad: |
---|
17 | " It ought to be noted that the generated list of function names |
---|
18 | " is only as accurate as the output of "diff -p", which is not very |
---|
19 | " accurate - e.g. for changes to a doc string appearing before a |
---|
20 | " function, it generally outputs the name of the _previous_ function. |
---|
21 | |
---|
22 | |
---|
23 | " goto start of patch and insert the header (until the .) |
---|
24 | :0 |
---|
25 | insert |
---|
26 | [[[ |
---|
27 | |
---|
28 | |
---|
29 | ]]] |
---|
30 | |
---|
31 | |
---|
32 | . |
---|
33 | |
---|
34 | |
---|
35 | " search for file and function names and put them before the ]]] |
---|
36 | :g/^\(---\|@@\)/normal ""yygg/]]]kk""p |
---|
37 | |
---|
38 | |
---|
39 | " change the copied lines to the wanted scheme |
---|
40 | :0 |
---|
41 | :1;/]]]/ s#--- \([^\t ]\+\).\+#\r* \1#e |
---|
42 | :1;/]]]/ s#@@ .\+ @@.*\<\(\w\+\) *(.*# (\1): #e |
---|
43 | " all lines without function names are ignored |
---|
44 | :1;/]]]/ g#@@ .\+#normal dd |
---|
45 | " remove duplicates |
---|
46 | :1;/]]]/ !uniq |
---|
Note: See
TracBrowser
for help on using the repository browser.