I need to find the number of commits for a directory within a repository. I will be dealing with the result within PHP so would probably need to utilise exec(). It will be running on Linux.
I have a slightly quirky repository where the directory structure looks a little like:
I'm going to use the result as part of the version number for each section. As it stands I use the latest revision but ideally would like to have it numbered sequentially instead of 84 -> 120 -> 400 etc.
I plan on counting the commits and using '3' instead of '400', using the above example.
If you really like to count the number of commits just use the following:
svn log -q --stop-on-copy URL/trunk | grep "^r" | wc -l
will printout the number of commits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With