I am using a benchmark environment to run performance tests on the working copy of trunk of company's code repository.
We have a large ant build file which manages the whole testing process (build database with sample data; build, deploy and run the product; build, deploy and run the grinder and monitoring tools; sampling various types of information). In the process there are two steps related to SVN:
- When building the product, the benchmark ant script calls the ant build file in the working copy, and
svn info
is called in a custom task to get the current revision number of the local working copy (from "The current revision is: 12345" line in the output), which will be used later to name the log-archive file. - When starting sampling, the benchmark ant script will first run
svn info
,svn status
,svn diff
in the working copy directory and save the outputs to log files.
Now other people want the benchmark ant script can also support git. So that the script should check if it is svn or git (this step is easy), and then run commands to collect version control information accordingly (confused with this step).
So my question is:
- What is the similar and different points between svn revision and git revision?
- What should I use to get the revision "number" in git (I know it's not a number) like what I do in "1" above??? Is it
git branch -v
? - What should I use in git to get as much information as I can get using svn, like what I do in "2" above??? Is
git remote -v
,git branch -v
,git log --max-count=1
,git status
,git diff
enough? - How can I use
git diff
to generate a diff file that can be used both in git and svn, as well as in other editors that supports to apply a diff?
Thanks.