-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add checks for commits with missing author and time #2771
Add checks for commits with missing author and time #2771
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2771 +/- ##
==========================================
- Coverage 27.21% 27.18% -0.03%
==========================================
Files 88 88
Lines 17348 17367 +19
==========================================
Hits 4721 4721
- Misses 11942 11961 +19
Partials 685 685
Continue to review full report at Codecov.
|
@@ -30,7 +32,7 @@ | |||
</th> | |||
<th class="nine wide"> | |||
</th> | |||
<th class="three wide text grey right age">{{TimeSince .LatestCommit.Author.When $.Lang}}</th> | |||
<th class="three wide text grey right age">{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th> |
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.
Missing an "else" here ?
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.
No, if there is no time than we just don't show anything
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.
or show -
?
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.
I don't think it's needed as it visually won't give any meaningful info
emails[c.Author.Email] = u | ||
} else { | ||
u = v | ||
} |
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.
If c.Author
is nil, then u
will keep its value from the previous iteration. Should we set u
to nil if c.Author
is nil?
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.
fixed
@ethantkoenig fixed |
LGTM |
How about give a ghost author struct which name is blank? I seached the whole repository, many place assumes commit.Author always not nil. So maybe you have to changed them all. |
@lunny better not in this PR because it needs to be done than in git library code but that would need to be tested carefully if that does not brake anything |
LGTM |
* Add checks for commits with missing author and time * Fix validate commits with emails if it has no Author
* Add checks for commits with missing author and time * Fix validate commits with emails if it has no Author
Can be reproduced in torvalds/linux repo where there are commits without author and/or time and tags that point not to commit but tree