Re: [RFC] Linux Kernel Subversion Howto

Michael S. Tsirkin
2005-02-04T10:17:14Z

Hi, Stelian!
One thing everyone creating kernel patches with subversion
must be aware of, is the fact that the subversion built-in diff command does
not understand the gnu diff -p flag (or indeed, any gnu diff flags at all,
with the exception of -u, which is the default anyway).

Thus you must use an external diff command to create kernel patches,
passing the -up flags to gnu diff, otherwise the patch is much less readable.
There are two good ways to do this that I know of:

1. Remember to always generate patches with:
svn diff --diff-cmd=/usr/bin/diff -x -up

2. Make subversion use gnu diff -up by defult to generate patches.

To do this, create a script that runs diff -up, passing any additional
parameters exactly as they are:

cat > /usr/bin/svndiff << EOF
#!/usr/bin/perl

exec("diff","-up",@ARGV);
EOF

chmod +x /usr/bin/svndiff

And set it as the default diff command in subversion:

cat >> ~/.subversion/config << EOF

[helpers]
diff-cmd = /usr/bin/svndiff

EOF

Tested with subversion 1.1.3.

--
MST - Michael S. Tsirkin