-
Notifications
You must be signed in to change notification settings - Fork 288
Identify author by email #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the email as a UID is definetely the right way to do it. Thanks @yoichi
I suggested some renaming to make it clearer.
src/info.rs
Outdated
@@ -489,10 +489,13 @@ impl Info { | |||
|
|||
fn get_authors(git_history: &[String], n: usize) -> Vec<(String, usize, usize)> { | |||
let mut authors = std::collections::HashMap::new(); | |||
let mut names = std::collections::HashMap::new(); | |||
let mut total_commits = 0; | |||
for line in git_history { | |||
let commit_author = line.split('\t').collect::<Vec<_>>()[1].to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be called commit_author_email
let mut total_commits = 0; | ||
for line in git_history { | ||
let commit_author = line.split('\t').collect::<Vec<_>>()[1].to_string(); | ||
let author_name = line.split('\t').collect::<Vec<_>>()[2].to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be called commit_author_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I think the following variable names are good because of the relationship with the format string of git log.
- %an = author_name
- %ae = author_email
I've renamed commit_author to author_email in c68e021
src/info.rs
Outdated
@@ -489,10 +489,13 @@ impl Info { | |||
|
|||
fn get_authors(git_history: &[String], n: usize) -> Vec<(String, usize, usize)> { | |||
let mut authors = std::collections::HashMap::new(); | |||
let mut names = std::collections::HashMap::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be called author_name_by_email
before

after
