I'd like to see a series of diffs for a file. I'd settle for simply the log listing restricted to only those entries that modified the file.
views:
1397answers:
5git log [filename]
. If you want to see what changed, git log -p [filename]
.
SVN Log for a single file
svn log filename.php
SVN diff for changes on a file between revision 1033 and 1191
svn -r 1033:1191 diff filename.php
svn log filename
or
svn log url
I also recommend adding --limit N to show only recent entries
svn log main.cpp --limit 4
These can be applied to a file or project, btw.
As far as SVN is concerned, if the file in question does not exist in the current revision, you would also need to specify a peg revision:
svn log path@some_revision_where_the_path_existed
If the peg revision is omitted, it defaults to HEAD (for a url) or BASE (for a working copy path).
Also note that if the file has been deleted and subsequently resurrected without history connecting it to the older file (which, believe it or not, I have seen this technique applied with good reason when a deep refactoring or technology shift is applied), the svn log will only show the changes associated with that particular peg revision.
If you want to see all of the changes that have ever been associated with a particular path, you have to do an svn log -v of the repository root and then filter the results by changed path.
GIT: In case the file is deleted from current branch (or otherwise is seen as an ambiguous argument by git)
git log -- [filename]