[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: John Szakmeister <john_at_szakmeister.net>
Date: 2004-07-31 02:03:32 CEST

On Friday 30 July 2004 18:19, kfogel@collab.net wrote:
> 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"

'cd ..; svn diff <name_of_dir>' would produce a '-p1' type patch as well.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jul 31 02:04:10 2004

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