← Back to team overview

yade-dev team mailing list archive

signing files automatically...

 

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      <eudoxos@xxxxxxxxxx>                          *
* (C) Janek Kozicki        <cosurgi@xxxxxxxxxx>                          *
* (C) Olivier Galizzi      <galizzi@xxxxxxxxxx>                          *
* (C) Vincent Richefeu     <richefeu@xxxxxxxxxx>                         *
* (C) Sergei Dorofeenko    <sega@xxxxxxxxxx>                             *

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                                 *
*  olivier.galizzi@xxxxxxx                                               *
*  Copyright (C) 2004 by Janek Kozicki                                   *
*  cosurgi@xxxxxxxxxx                                                    *
*                                                                        *
*  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      <eudoxos@xxxxxxxxxx>                          *
* (C) Janek Kozicki        <cosurgi@xxxxxxxxxx>                          *
* (C) Olivier Galizzi      <galizzi@xxxxxxxxxx>                          *
* (C) Vincent Richefeu     <richefeu@xxxxxxxxxx>                         *
* (C) Sergei Dorofeenko    <sega@xxxxxxxxxx>                             *
*                                                                        *
*  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                                                         |