Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

subversion diff including new files

Tags:

I have some local changes to an open source project which uses Subversion as its source control. (I do not have commit access on the original project repository.)

My change adds a file, but this file is not included in the output of "svn diff". (It may be worth noting that the new file is a binary, not plain text.)

How can I make a patch which includes the new files?


 $ svn st
   A      tests/foo.zip
 $ svn diff
 $
like image 365
Jeremy Dunck Avatar asked Oct 01 '08 21:10

Jeremy Dunck


People also ask

How can I find the difference between two files in svn?

If you want to see the differences between a file in your working copy, and a file in any Subversion repository, you can do that directly in explorer by selecting the file then holding down the Shift key whilst right clicking to obtain the context menu. Select TortoiseSVN → Diff with URL.

What does svn diff do?

svn diff (di) — This displays the differences between two revisions or paths.

How do you find changed files in svn?

The solution here is to either update your working copy or explicitly provide a revision number to svn log by using the --revision ( -r ) option. svn log also takes a --quiet ( -q ) option, which suppresses the body of the log message. When combined with --verbose ( -v ), it gives just the names of the changed files.

How do I commit changes in svn?

Select any file and/or folders you want to commit, then TortoiseSVN → Commit.... The commit dialog will show you every changed file, including added, deleted and unversioned files. If you don't want a changed file to be committed, just uncheck that file.


1 Answers

I experienced similar behavior to Pozsar. And his answer worked for me better than the normal svn diff --force. However, if running on a DOS machine (e.g. via Cygwin), you may need to modify his answer slightly. The following diff + patch worked for patching my text + binary files in Cygwin using the --binary arg:

svn diff --force --diff-cmd /usr/bin/diff -x "-au --binary" OLD-URL NEW-URL > mybinarydiff.diff

patch -p0 --binary -i mybinarydiff.diff
like image 148
Jason Favors Avatar answered Oct 01 '22 01:10

Jason Favors