I'm trying to find the proper command in subversion to see a list of all the files that have changed (don't need to see the changes really) between branch/tag A and branch/tag B, etc.
How about svn diff --summarize <A> <B>
You may also use svn diff --help to get more options
and svn status --help to get explanations on all possible modification description letters ('A', 'M' etc.)
SVN DIFF is what you are looking for. Should be able to specify the urls to the different branches
svn diff http://domain.com/tags/A http://domain.com/tags/B
Related
Lets assume I have a commit with a known hash, and the commit touches 1000 files of 5000 files of the project.
Among some of those files there was added the log message LOG_WARNING(...);, lets say 500 times. Which I want to replace by LOG_INFO(...);.
I don't want to replace all LOG_WARNING(...); in the project (lets say it has 10000 of them), just ones, related to the specified commit.
I'm ready to walk over each of 500 lines I have to modify, but I'm trying to avoid walking over 10000 existing log-lines in the codebase.
What is the best way (practice) to do it?
I would do it that way:
git show --name-only <commit> | xargs sed -i 's/LOG_WARNING/LOG_INFO/'
The git command give the filenames part of the commit.
xargs provides these files to sed which replaces the wanted pattern.
What did help to me:
git diff (...) > patchfile -- extract all changes of current commit to a patchfile
edit patchfile -- using any editing tool & script, but in the patchfile I had to deal with only LOG_WARNING of specified commit.
git reset --hard -- to get rid of the commit I'm going to modify
git apply patchfile -- applies "patch", containing exactly my commit, but with replacement I wanted to.
It does the job. And relatively quickly.
I have no local copies of any files from the SVN repository. I do have a full path URL to some file in SVN. How can I see the difference between revision 1234 of that file, and it's previous revision, whatever it may be?
svn diff -c 1234 $URL
Assuming you are using a version of Subversion newer than 1.4 when -c was added. Otherwise you need to do:
svn diff -r 1233:1234 $URL
If you want to see a diff including changes across multiple revisions you can just expand the revision numbers you provide to -r.
You can see detailed documentation of the diff subcommand in the SVN Book.
So I want to compare this folder http://cloudobserver.googlecode.com/svn/branches/v0.4/Boost.Extension.Tutorial/libs/boost/extension/ with this http://svn.boost.org/svn/boost/sandbox/boost/extension/. I want to get a diff file as a result. These folders are under svn control but I'd prefer git styled diff file (like one shown here) I tried git diff but it seems not to work that way for web folders. So how to do the same thing with one command on Linux?
Update:
So we had a great answer. But it works strangely - it seems to me it shows that all files (same files) have all theire contents replaced with very same contents (while I know for sure that there were only like 3-4 code lines changed at all)...
Update 2:
To achieve what I really needed (dif file with only really changed lines, with git styling, on Linux) do:
$ svn export http://cloudobserver.googlecode.com/svn/branches/v0.4/Boost.Extension.Tutorial/libs/boost/extension/ repos2 --native-eol CRLF
$ svn export http://svn.boost.org/svn/boost/sandbox/boost/extension/ repos --native-eol CRLF
$ git diff repos repos2 > fileWithReadableDiff.diff
Once you have the source trees, e.g.
diff -ENwbur repos1/ repos2/
Even better
diff -ENwbur repos1/ repos2/ | kompare -o -
and have a crack at it in a good gui tool :)
-Ewb ignore the bulk of whitespace changes
-N detect new files
-u unified
-r recurse
You urls are not in the same repository, so you can't do it with the svn diff command.
svn: 'http://svn.boost.org/svn/boost/sandbox/boost/extension' isn't in the same repository as 'http://cloudobserver.googlecode.com/svn'
Another way you could do it, is export each repos using svn export, and then use the diff command to compare the 2 directories you exported.
// Export repositories
svn export http://svn.boost.org/svn/boost/sandbox/boost/extension/ repos1
svn export http://cloudobserver.googlecode.com/svn/branches/v0.4/Boost.Extension.Tutorial/libs/boost/extension/ repos2
// Compare exported directories
diff repos1 repos2 > file.diff
What's the best way to export changes between 2 SVN revisions and save the changes (files/folders) locally?
Possibly through the command-line?
Thanks
How about this
svn checkout -r {2006-02-17}
http://svnbook.red-bean.com/en/1.4/svn.tour.revs.specifiers.html
esssentially you would "checkout" two folders based on dates.
EDIT: A simple folder compare at that point would give you what files changed, and what changed in the files.
EDIT2: Perhaps something along the lines of :
svn diff -r BASE:HEAD foo.c
or
svn diff -r HEAD
Not sure if you can do something like
svn diff -r BASE:HEAD
where you can update base to a number and head to a number.
My suspicion is that since this works:
svn diff -r BASE:14 foo.c
you should be able to replace base and head with numbers and just compare all the files.
I'm really not sure though.
How to find the deleted lines of code between two date range in SVN. I am using Tortoise SVN.
You can use the diff command to do so and grep in the output the "-" sign which is indicating a line has been deleted.
svn diff -rRange URL1 URL2
You want to "diff" between two files.
To find the dates, you can look at the revision logs.