From 55ff399da5345c5ff149b1027a190f4d436a6eb9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 15 Nov 2005 15:07:17 +0000 Subject: [PATCH] Updated the output of the contributors list. --- applications/osgversion/GNUmakefile | 2 +- applications/osgversion/osgversion.cpp | 138 +++++++++++++++++++------ 2 files changed, 109 insertions(+), 31 deletions(-) diff --git a/applications/osgversion/GNUmakefile b/applications/osgversion/GNUmakefile index d1c2a056c..b3f66c588 100755 --- a/applications/osgversion/GNUmakefile +++ b/applications/osgversion/GNUmakefile @@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs CXXFILES =\ osgversion.cpp\ -LIBS += -losgProducer -lProducer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) +LIBS += -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) INSTFILES = \ $(CXXFILES)\ diff --git a/applications/osgversion/osgversion.cpp b/applications/osgversion/osgversion.cpp index 957273fe3..87074f2b1 100644 --- a/applications/osgversion/osgversion.cpp +++ b/applications/osgversion/osgversion.cpp @@ -8,11 +8,12 @@ #include typedef std::pair NamePair; -typedef std::set NameSet; +typedef std::map NameMap; typedef std::vector< std::string > Words; NamePair EmptyNamePair; - +NamePair NameRobertOsfield("Robert","Osfield"); +NamePair NameDonBurns("Don","Burns"); bool validName(const std::string& first) { @@ -132,6 +133,7 @@ bool validName(const std::string& first) if (first=="KeyboardMouse") return false; if (first=="KeyboardMouseCallback") return false; if (first=="AutoTransform") return false; + if (first=="AutoTransform.") return false; if (first=="LightModel") return false; if (first=="MatrixManipulator") return false; if (first=="MatrixTransform") return false; @@ -337,9 +339,12 @@ NamePair createName(const std::string& first, const std::string& second) if (last>0) { std::string surname(second.begin(), second.begin()+last); - surname = typoCorrection(surname); - - return NamePair(name, surname); + + if (validName(surname)) + { + surname = typoCorrection(surname); + return NamePair(name, surname); + } } // filter any single or two letter words as unlike to be names. @@ -374,6 +379,12 @@ bool submissionsSequence(const Words& words, unsigned int& i) return true; } + if (words[i]=="Rolled" && words[i+1]=="in") + { + i+=1; + return true; + } + if (words[i]=="Checked" && words[i+1]=="in") { i+=1; @@ -391,7 +402,7 @@ bool submissionsSequence(const Words& words, unsigned int& i) return false; } -void readContributors(NameSet& names, const std::string& file) +void readContributors(NameMap& names, const std::string& file) { std::ifstream fin(file.c_str()); @@ -413,32 +424,45 @@ void readContributors(NameSet& names, const std::string& file) { NamePair name = createName(words[i+1], words[i+2]); nameCorrection(name); - if (!name.first.empty()) names.insert(name); + if (!name.first.empty()) ++names[name]; i+=2; } else if (i+11) { - for(NameSet::iterator itr = names.begin(); + for(NameMap::iterator itr = names.begin(); itr != names.end(); ) { - if (itr->second.empty()) + if (itr->first.second.empty()) { - NameSet::iterator next_itr = itr; + NameMap::iterator next_itr = itr; ++next_itr; - if (next_itr!=names.end() && itr->first==next_itr->first) + if (next_itr!=names.end() && itr->first.first==next_itr->first.first) { + next_itr->second += itr->second; names.erase(itr); itr = next_itr; } @@ -453,20 +477,42 @@ void readContributors(NameSet& names, const std::string& file) } } } + + // remove the double entries from Robert's contributions + if (names.size()>1) + { + for(NameMap::iterator itr = names.begin(); + itr != names.end(); + ++itr) + { + if (itr->first != NameRobertOsfield && itr->first != NameDonBurns ) + { + names[NameRobertOsfield] -= itr->second; + } + } + } + + } -void buildContributors(NameSet& names) +void buildContributors(NameMap& names) { - names.insert(NamePair("Robert","Osfield")); - names.insert(NamePair("Don","Burns")); - names.insert(NamePair("Marco","Jez")); - names.insert(NamePair("Karsten","Weiss")); - names.insert(NamePair("Graeme","Harkness")); - names.insert(NamePair("Axel","Volley")); - names.insert(NamePair("Nikolaus","Hanekamp")); - names.insert(NamePair("Kristopher","Bixler")); - names.insert(NamePair("Tanguy","Fautré")); - names.insert(NamePair("J.E.","Hoffmann")); + // top five contributors + ++names[NamePair("Robert","Osfield")]; + ++names[NamePair("Don","Burns")]; + ++names[NamePair("Marco","Jez")]; + ++names[NamePair("Mike","Weiblen")]; + ++names[NamePair("Geoff","Michael")]; + + // contributors that don't appear in the ChangeLog due to their contributions + // being before CVS started for the OSG, or before the name logging began. + ++names[NamePair("Karsten","Weiss")]; + ++names[NamePair("Graeme","Harkness")]; + ++names[NamePair("Axel","Volley")]; + ++names[NamePair("Nikolaus","Hanekamp")]; + ++names[NamePair("Kristopher","Bixler")]; + ++names[NamePair("Tanguy","Fautré")]; + ++names[NamePair("J.E.","Hoffmann")]; } int main( int argc, char **argv) @@ -474,13 +520,18 @@ int main( int argc, char **argv) osg::ArgumentParser arguments(&argc,argv); arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]"); arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); - arguments.getApplicationUsage()->addCommandLineOption("-c or --contributors","Print out the contributors list."); - arguments.getApplicationUsage()->addCommandLineOption("-r or --read ","Read the changelog to generate an estimated contributors list."); + arguments.getApplicationUsage()->addCommandLineOption("--entries","Print out number of entries into the ChangeLog file for each contributor."); + arguments.getApplicationUsage()->addCommandLineOption("-r or --read ","Read the ChangeLog to generate an estimated contributors list."); std::cout< SortedNameMap; + + SortedNameMap sortedNames; + for(NameMap::iterator itr = names.begin(); itr != names.end(); ++itr) { - std::cout<<" "<first<<" "<second<second, itr->first)); + } + + std::cout<first<<"\t"<second.first<<" "<second.second<second.first<<" "<second.second<