Conversation
(I don't intend to be nitpicking about whitespace, but without a separate commit the following commits would become dirty).
The "authors" return value should be a list (of author dicts), but in case of failure it returned an empty string. This was incorrectly handled in Util.summarize(), but fortunately with no negative effect: - iterating over a string returns its characters, but - iterating over an empty string behaves like iterating over an empty dict.
Create a cache dictionary, with file paths as key. Util.get_authors() is called twice, and there's no need to call Git twice if we can cache the results.
This has been inadvertently been overwritten by copy/paste
Closes timvink#1 This flag for the git.Repo initializer will search parent directories for a valid Git repository too.
Sometimes authors commit with different email addresses or change them over time. This commit changes the key in the authors dictionary to be commit.author.name to merge such "virtual committers" (if they have differing user names there's not much we can do about it). In addition this commit also displays the contribution percentage (since that has already been calculated), but only if there's more than one contributor to the page. Eventually I think this should be made configurable (switch on/off and a template), but this is a more involved consideration about the interface that I don't want to "do" without a discussion.
|
Hi @uliska, thanks again! This MR is actually two things.
In short, I recommend removing 1) for now, making it a separate PR. And then either closing or improving on 2) |
|
Ok, I'll separate the topics and read up pn options and unit tests tomorrow.
--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
|
|
I'll close this PR now and will open two new ones when I'm ready. |
Merge authors and show contribution
Sometimes authors commit with different email addresses or
change them over time. This commit changes the key in the authors
dictionary to be commit.author.name to merge such "virtual committers"
(if they have differing user names there's not much we can do about it).
(This is again on top of #2 and #3, although it is conceptually independent from them)