12

Is there an equivalent of git log -p using the svn command line tool? svn log -v shows file names but not changes.

I would like to see the patches introduced by prior commits. If not possible, is there a way to get the patch (not compared to head, just the changeset) introduced by a single previous commit?

2
  • 6
    Use git svn as your Subversion client? Commented Sep 28, 2011 at 19:11
  • As far as I can tell, it makes a patch file. Commented Sep 28, 2011 at 19:17

2 Answers 2

18

svn log --diff is the equivalent of git log -p.

For a single revision you can use svn diff -c <revision> which in git would be git show <revision>.

Sign up to request clarification or add additional context in comments.

3 Comments

FYI this is only in version 1.7, and when writing this question the latest version out was 1.6. For 1.7 this is the right answer. Fortunately I don't have to deal with svn anymore.
True, svn log --diff is new with 1.7. svn diff -c worked with 1.6
and equivalent of HEAD or HEAD^2 etc. ?
2

There's not an exact match; because, git deals with files while svn deals with filesystems. However, there are close matches.

svn diff does most of what git log -p does. Someone else has already written up a nice tutorial on how to make and apply patches using svn commands. I think you might find it useful.

Note that while the tutorial makes a patch file of local changes against the last checked out version, you can also use the -r 4:7 options to construct a patch of all changes between revisions 4 and 7. Some combination of svn log to identify the specific revisions and svn diff probably will give you exactly what you want.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.