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

[PATCH] Re: Patch ping, 5 years later: removing properties

From: Alexey Neyman <aneyman_at_lnxw.com>
Date: Wed, 16 Nov 2011 16:09:51 -0800

On Sunday, November 06, 2011 10:27:01 am Daniel Shahaf wrote:
> Perhaps the solution is to make 'svn diff' use --diff-cmd for propdiffs
> too? It seems that currently --diff-cmd is only used for file content
> diffs.

I guess this is sort of a feature. As Julian pointed out, the property diffs
are output using a different hunk format that starts with ## instead of @@.
Thus invoking an external diff utility (which does not know whether it is
diffing, content or property) would actually make the problem worse.

FWIW, I implemented the --patch option for 'svn diff' as suggested - implying
no property diffs and copies-as-additions. Patch against trunk, r1202879;
survives 'make check'.

[[[
* subversion/svn/cl.h
* subversion/svn/main.c
  New option, --patch for svn diff.

* subversion/include/svn_client.h
  (svn_client_diff6,svn_client_diff_peg6): New argument, ignore_prop_diff.
  (svn_client_diff5,svn_client_diff_peg5): Update comments.

* subversion/libsvn_client/deprecated.c
  (svn_client_diff5,svn_client_diff_peg5): Pass FALSE as ignore_prop_diff.

* subversion/libsvn_client/diff.c
  (diff_cmd_baton): New field, ignore_prop_diff
  (diff_props_changed): Do nothing if diff_cmd_baton->ignore_prop_diff is set.
  (svn_client_diff6,svn_client_diff_peg6): Pass ignore_prop_diff downstream
  via diff_cmd_baton.

* subversion/svn/diff-cmd.c
  (svn_cl__diff): Handle --patch: ignore property diff, force
  --show-copies-as-adds.

* subversion/svn/log-cmd.c
  (log_entry_receiver): Request property changes from svn_client_diff6.
]]]

Best regards,
Alexey.

>
> C. Michael Pilato wrote on Thu, Nov 03, 2011 at 15:16:23 -0400:
> > The introduction of the --git option to 'svn diff' opens the door for
> > different "flavors" for 'svn diff' output. Would you be interested in a
> > new 'svn diff --patch' flavor, which generates only diff output that's
> > suitable for consumption with GNU patch? Implied by --patch would be no
> > property diff output and the display of copied items as additions (like
> > --show-copies-as-adds does).
> >
> > Of course, --no-property-diff works for me, too. :-)
> >
> > On 11/03/2011 03:05 PM, Alexey Neyman wrote:
> > > Hi all,
> > >
> > > Sorry for a long delay :) 5 years ago, I sent a patch to the mailing
> > > list that
> > >
> > > would allow to specify what to include/exclude from the diff output:
> > > http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessag
> > > eId=742594
> > >
> > > There were two problems this patch tried to address:
> > >
> > > 1. There was no way to exclude properties from the diff output.
> > >
> > > 2. There was no way to obtain a list of modified/added/deleted files
> > > and whether the content and/or properties have been modified.
> > >
> > > I got a response from Ben Collins-Sussman that the patch I sent is
> > > superseded by --summarize option which was implemented in the trunk
> > > (which would
> > >
> > > eventually become 1.4):
> > > http://svn.haxx.se/dev/archive-2006-06/0202.shtml
> > >
> > > Actually, --summarize only addresses the issue #2, but not the issue
> > > #1. As to issue #1, ability to disable property diffs is still missing
> > > from Subversion.
> > >
> > > Common wisdom suggests running the diff through 'filterdiff --clean':
> > > http://stackoverflow.com/questions/2755848/how-do-you-get-subversion-
> > > diff-
> > >
> > > summary-to-ignore-mergeinfo-properties
> > >
> > > http://stackoverflow.com/questions/402522/is-there-a-metadata-exclusi
> > > on-
> > >
> > > filter-for-the-svn-diff-command
> > >
> > > But this is still unreliable: if property text includes a diff-like
> > > chunk, it will go through.
> > >
> > > What is the sentiment about implementing --no-property-diff option to
> > > 'svn diff'? I can implement it if there's agreement such option is
> > > needed.
> > >
> > > Regards,
> > > Alexey.

Received on 2011-11-17 01:10:44 CET

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.