February 16, 2016

Darcs shell hacks

Posted on February 16, 2016  •  2 minutes  • 252 words  •  Suggest Changes

darcs is a version control system, such as svn, git, mercurial, … while its losing the popularity match against pretty much all other vcs’s it’s still used where I work. I’m not a huge fan, but that’s beside the point. For reporting matter (eg. bosses) its nice to show a fancy graph, that productivity is growing over the years. Hence I find myself in need of getting historical data from darcs, darcs unlike the other vcs’s don’t have allot of nice fancy tools for pulling graphs. So here I’d like to share some shell “hacks” to get them.

Getting commits for each year :

for VARIABLE in {2000..2016}; do 
darcs changes --xml-output | grep "<patch"  | grep "date='$VARIABLE" | grep eter | wc -l; 

Getting commits for a single person for each year, in this case “tom”, note that names of authors might change : Tom, tom, lastnameT, …

for VARIABLE in {2000..2016}; do 
darcs changes --xml-output | grep "<patch"  | grep "date='$VARIABLE" | grep tom | wc -l; 

Getting all Lines of code over patches. (#patch 1 : 100, #patch 2 : 105, …) (source)
note : cat /tmp/darcslog will contain a list from last patch to first patch with the lines of code.

darcs trackdown 'find . -type f -print | xargs wc -l | tail -1 | tee -a /tmp/darcsloc; false'

Show all authors :

darcs show authors

Show repo info (including #of patches)

darcs show repo


Know any other hacks/scripts for darcs, feel free to share!


If you enjoyed this website, consider buying me a Dr. Pepper

Buy me a Dr PepperBuy me a Dr Pepper