Everyone knows `svn blame`, now this command:
svn blame core/MetaBody.hpp | awk '{print $2}'
Or better, this one :)
svn blame core/MetaBody.hpp | awk '{print $2}' | sort | uniq -c
Or even better, lets sort according to number of lines modified by
each person:
svn blame core/MetaBody.hpp | awk '{print $2}' | sort | uniq -c | sort -rn
Now, we can automatically update all files, just replace people's
usernames with their real names and emails (I just committed AUTHORS
file for that), like this:
svn blame core/MetaBody.hpp | awk '{print $2}' | sort | uniq -c | \
sort -rn | awk '{print $2}' | \
xargs -n 1 -I person fgrep person AUTHORS | sed -e 's/\(.*\)/* (C)\1
*/'
And you will get output like this:
* (C) Vaclav Smilauer <[email protected]> *
* (C) Janek Kozicki <[email protected]> *
* (C) Olivier Galizzi <[email protected]> *
* (C) Vincent Richefeu <[email protected]> *
* (C) Sergei Dorofeenko <[email protected]> *
So we can update "Authors" part of files by writing a simple script
that will parse `svn blame` output and replace the current long-outdated
file headers, like this one from MetaBody.hpp:
/*************************************************************************
* Copyright (C) 2004 by Olivier Galizzi *
* [email protected] *
* Copyright (C) 2004 by Janek Kozicki *
* [email protected] *
* *
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
with something like that:
/*************************************************************************
* (C) Vaclav Smilauer <[email protected]> *
* (C) Janek Kozicki <[email protected]> *
* (C) Olivier Galizzi <[email protected]> *
* (C) Vincent Richefeu <[email protected]> *
* (C) Sergei Dorofeenko <[email protected]> *
* *
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
Just run such script from time to time on all files, and we are done.
I didn't write this script ;) But in this email you already have the
most interesting part - parsing `svn blame` output :)
--
Janek Kozicki |
_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help : https://help.launchpad.net/ListHelp