[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn diff -p1 ?

From: <kfogel_at_collab.net>
Date: 2004-07-31 00:19:09 CEST

Alexey Dobriyan <adobriyan@mail.ru> writes:
> 1. svn diff -p1 (but not p2, p3, ...)
> (I think is optimal)
>
> svn_diff_file_output_unified() gets new parameter -
> 'unsigned int patch_level'. 0 means "-p0" patches , 1 means "-p1" ones.
>
> Logic of svn_diff_file_output_unified() becomes
> if (patch_level) {
> printf("--- a/"); ...
> printf("+++ b/"); ...
> } else {
> printf("--- "); ...
> printf("+++ "); ...
> }
>
> svn_diff_file_output_unified(...) becomes
> svn_diff_file_output_unified(... , 0); to not break other people.
>
> Next step: get "-p1" option from command line, propagate patch_level down.
> Smells like API change for me. Comments on this are extremely welcome.
>
> I do not know a project which demands -p2 and greater levels. If there is
> one go to #2. :)
>
> 2. svn diff -pN
>
> Everything like in #1 with an obvious change in output.

Unfortunately, all options share the same namespace, and using "-p"
for something so diff-specific probably wouldn't be a good allocation.

However, can't you generate -p1 patches with

   $ svn diff --diff-cmd=/usr/bin/diff -x "-p1"

?

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jul 31 01:52:05 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.