Is there a metadata exclusion filter for the SVN DIFF command?

I use SVN as the source control system, and I wonder how to compare directories while ignoring any metadata differences. Is there a way to tell svn diff to compare only the actual content and ignore any metadata?

I mean metadata like SVN properties, etc. that don't affect the file content. Assume file X has an additional property in branch B compared to trunk T. Unfortunately it will show up in 'svn diff T B' even though the actual content of file X is the same.

I look for something like this:

svn diff https://example.org/tags/v1 https://example.org/tags/v2 -x -ignore-metadata --summarize

Update: I partially solved this by diff'ing directly on the filesystem instead of using the SVN tools. See my own answer below...

You can pass the svn diff output through 'filterdiff --clean' to remove any extraneous lines including property changes.

How to remove SVN Properties from SVN Diff, SVN Properties in SVN Diff, how to remove SVN properties from svn diff, shell I run “svn diff” command, it gives a whole bunch of SVN Properties changes in output. However, it depends on project structure and metadata usage. It can also be used to do things like filter a diff based on file patterns, or even line numbers  Sometimes I need to see the difference between two tags or two branches but when I run “svn diff” command, it gives a whole bunch of SVN Properties changes in output. I was looking for a way to remove these but built in svn diff options doesn’t provide this feature.

If you use the --summarize option, then property changes are indicated in the second rather than the first column.

I.e.,

M  URL  -- indicates content change
 M URL  -- property change
MM URL  -- content and property change

It is a bit easier to grep. I guess you could have a two-stage process if you want a full diff - first use summarize to find files with content change, then diff them.

Version Control with Subversion - SVN Book, First, it will help you compare and contrast existing version control systems, There is one notable exception to Subversion's handling of URLs which also Second, you cannot commit a metadata change to a directory unless it's fully up to date. The --changelist option acts only as a filter for Subversion command targets,  svn Reference—Subversion Command-Line Client svn is the official command-line client of Subversion. Its functionality is offered via a collection of task-specific subcommands, most of which accept a number of options for fine-grained control of the program's behavior.

Nice tip from JosephWatkins.

Here is the command for the grep-junior-users:

svn diff A B --summarize | grep '^. '

The grep looks for a space as the second character on the line.

git-svn Documentation, It provides a bidirectional flow of changes between a Subversion and a git Initializes an empty git repository with additional metadata directories for git svn. If the ignore-paths config key is set and the command line option is also given, both Commit each diff from a specified head directly to the SVN repository, and​  Using vimdiff for svn diff?. Hi all, I love vimdiff and would want to be able to somehow show the differences between the repository and my local file(s) in vimdiff instead of plain diff output

Found this while searching through the svn help docs

svn diff --patch-compatible

It's the same as running

svn diff --show-copies-as-adds --ignore-properties

Ignoring Files And Directories, Whenever you commit changes, TortoiseSVN shows your unversioned files, which fills and select the command TortoiseSVN → Add to Ignore List from the context menu, If you select multiple files, there is no submenu and you can only add those The big difference here is that the global ignore list is a client property. It  Use just svn diff to display local modifications in a working copy.. Display the changes made to TARGETs as they are seen in REV between two revisions.

There seems to be no way to get this done using the svn built-in tools. How I solved it: Export both trees and diff them diretly on the filesystem using your favourite diff tool. That's somehow the only way to get this done :/

Apache Subversion FAQ, How can I make 'svn commit' ignore the file? Why does my --diff-cmd complain about '-u'? I tried to override it with --extensions, but it's not The changes might include textual edits to file contents, modifications to tree structure, or tweaks to metadata. In many other cases proxies don't filter https as strict as they filter http​. To make clear what is actually compared, a diff output always starts by declaring which files are represented by "A" and "B". File Metadata. The file metadata shown here is a very technical information which you'll probably never need in practice.

Apache Subversion 1.8 Release Notes, This command may take a while, and for some users, it may be more practical to Unfixable problems can arise from missing or corrupt meta-data inside .svn Subversion 1.7 and earlier would silently ignore those sections of the authz file; The svn diff command can compare arbitrary files with one another, using the  svn is the official command-line client of Subversion. Its functionality is offered via a collection of task-specific subcommands, most of which accept a number of options for fine-grained control of the program's behavior. When using the svn program, subcommands and other non-option arguments must appear in a specified order on the command line.

Version Control with Subversion [DRAFT] For Subversion 1.8, IX. svnmucc Reference—Subversion Multiple URL Command Client A program for filtering Subversion repository dump streams users will eventually come into contact with, such as versioned metadata, file locking, and peg revisions. There's one exception to how property changes are reported by svn diff: changes to  marked as duplicate by Josh Kelley, Lazy Badger svn Users with the svn badge can single-handedly close svn questions as duplicates and reopen them as needed. Sep 11 '14 at 17:11. This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

However the problem is that SVN engine that I used created in every folder of the project the .svn metadata directory. I want to clean all folders of the project of this hidden folder. Is there any terminal command to search in folder and clean it ?

Comments
  • What do you mean by metadata?
  • "SVN properties" is a better word to describe it. I fixed my post to clarify this..
  • Working as advertised - great! A hint for Debian / Ubuntu users: if filterdiff is not on your system, you can install it via apt-get install patchutils.
  • Newer versions of svn (tested on 1.9.3) provide a builtin way to do this: stackoverflow.com/a/50515644/5749914 or stackoverflow.com/a/18984711/5749914.
  • Sorry. It must be svn diff A B --summarize | grep -v '^ ' All Lines starting with a space must be hidden, because there where only property changes on files.
  • This does not handle cases where file content and properties are both changed, or where something else, like locking, happened to the file and the file is modified.
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
  • Does it not? The author's question asked how to get svn diff to ignore all subversion properties when doing a diff. That's precisely what svn --ignore-properties does. Maybe I should have worded it better as an answer. I'll try to do so in the future.
  • @ryadavilli why are stackoverflow reviewers so obtuse?
  • The whole diff comes only as a huge amount of text, I would have to manually parse it to filter out all 'svn property added'-like changes. No easy task I can get done using grep unfortunately.
  • I don't want to ignore specific directories or files, it's about ignoring differing properties (aka metadata) of the same files. Assume file X has an additional property in branch B compared to trunk T. It will show up in svn diff even though the actual content is the same.