1

I was wondering if it's possible to extract a diff or patch file from a svn commit, directly from the url without needing svn?

For example, if I'm given the following GitHub url of a specific commit, there is a trick where I can just add .diff to the url and get the diff file:

GitHub Commit page -> GitHub Diff from that Commit page

On sourceforge, I have to download the entire trunk then generate my patch as follows:

svn checkout svn://svn.code.sf.net/p/saga-gis/code-0/trunk saga-gis-trunk

svn diff -r r1918:r1919 > saga-2.1.0-vigra-bug173.patch

1 Answer 1

3

You can't get a diff with a web browser but with a svn client you can get a diff without a checkout.

The following command will give you the diff without the checkout:

svn diff -c 1919 svn://svn.code.sf.net/p/saga-gis/code-0/trunk > saga-2.1.0-vigra-bug173.patch
3
  • Thanks. I'd like to still encourage other answers if someone knows of a way or if it's made available in the future.
    – SaultDon
    Jan 9, 2014 at 0:23
  • Just for clarity, some sites might be running viewvc or various web apps that are designed to allow this sort of interaction. But that's not a core feature of Subversion. For instance sourceforge has something like this, to use your own example: sourceforge.net/p/saga-gis/code-0/1919 GitHub is very much like a sourceforge in this respect, they have a webapp on top of Git. Git doesn't provide anything like the feature you want natively, and actually you would have to download the repo to get a diff.
    – Ben Reser
    Jan 9, 2014 at 1:10
  • I can get a diff from any github commit by modifying the url. This allows them to be retrieved, without requiring a git client, to a file with wget or something. Sourceforge only lets me view the diff, not actually retrieve it (can always copy and paste). I will need svn to get any patch from svn commits on sourceforge. So I guess it would be nice to be able to get patches from svn commits via sourceforge hosted projects at the website.
    – SaultDon
    Jan 9, 2014 at 1:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .