mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-01 18:26:24 +08:00
* sort by last name alphabetically
* replace (no own changesets) by (no information)
This commit is contained in:
parent
68988e4ad0
commit
ddfd23a13e
@ -86,6 +86,15 @@ map<string,int> contributors_map_from_churn_output(const char *filename)
|
|||||||
return contributors_map;
|
return contributors_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// find the last name, i.e. the last word.
|
||||||
|
// for "van den Schbling" types of last names, that's not a problem, that's actually what we want.
|
||||||
|
string lastname(const string& name)
|
||||||
|
{
|
||||||
|
size_t last_space = name.find_last_of(' ');
|
||||||
|
if(last_space >= name.length()-1) return name;
|
||||||
|
else return name.substr(last_space+1);
|
||||||
|
}
|
||||||
|
|
||||||
struct contributor
|
struct contributor
|
||||||
{
|
{
|
||||||
string name;
|
string name;
|
||||||
@ -98,7 +107,7 @@ struct contributor
|
|||||||
|
|
||||||
bool operator < (const contributor& other)
|
bool operator < (const contributor& other)
|
||||||
{
|
{
|
||||||
return changedlines > other.changedlines;
|
return lastname(name).compare(lastname(other.name)) < 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -155,11 +164,6 @@ void add_online_info_into_contributors_list(list<contributor>& contributors_list
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ostream& operator<<(ostream& stream, const contributor& c)
|
|
||||||
{
|
|
||||||
stream << c.name << "|" << c.changedlines << "|" << c.changesets << "|" << c.url << "|" << c.misc;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
// parse the hg churn output files
|
// parse the hg churn output files
|
||||||
@ -185,7 +189,7 @@ int main()
|
|||||||
cout << "{| cellpadding=\"5\"\n";
|
cout << "{| cellpadding=\"5\"\n";
|
||||||
cout << "!\n";
|
cout << "!\n";
|
||||||
cout << "! Lines changed\n(changesets)\n";
|
cout << "! Lines changed\n(changesets)\n";
|
||||||
cout << "! Misc\n";
|
cout << "!\n";
|
||||||
|
|
||||||
list<contributor>::iterator itc;
|
list<contributor>::iterator itc;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -201,7 +205,7 @@ int main()
|
|||||||
if(itc->changedlines)
|
if(itc->changedlines)
|
||||||
cout << "| " << itc->changedlines << " (" << itc->changesets << ")\n";
|
cout << "| " << itc->changedlines << " (" << itc->changesets << ")\n";
|
||||||
else
|
else
|
||||||
cout << "| (no own changesets) \n";
|
cout << "| (no information)\n";
|
||||||
cout << "| " << itc->misc << "\n";
|
cout << "| " << itc->misc << "\n";
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user