Skip to content

Comments

Update author annotation to give partial authorship for code blocks#1

Open
hpkoh wants to merge 4 commits intomasterfrom
branch-Update-AuthorAnnotation
Open

Update author annotation to give partial authorship for code blocks#1
hpkoh wants to merge 4 commits intomasterfrom
branch-Update-AuthorAnnotation

Conversation

@hpkoh
Copy link
Owner

@hpkoh hpkoh commented Dec 18, 2021

A particular code block might have input from more than 1 person.
For example, another person might have resolved conflicts that arose
from a merge. Current assignment is all or nothing for any particular
line.

Let's extend the author notation to credit multiple contributors
with fields to enter a percentage representation of contribution.

Example of an annotation:
"@@author hpkoh 30 xyz 70" of a particular code block give
@hpkoh authorship of 30% of the total lines and @xyz authorship of
70 percent of the total lines.

TextBlockInfo class encapsulates blocks of codes that are group together
typically because the accurate attribution of that particular block deviates
from the git blame information and is manually annotated.
Lines belonging to this class is removed from FileInfo.lines so they are not iterated through doubly
like before.

TextBlockInfo.contributionMap stores the contribution weight of every author given in the author tag
In the above example
"hpkoh" will have the value "30" and "xyz" will have the value "70"

TextBlockInfo.absoluteContributionMap maps each author with the implicit number of lines attributed
to them for the authorship report. It is derived simply by multiplying the total number of lines by the by
the relatively weight of authorship for each author.
For example, if the above example is for a code block of 50 lines, hpkoh will be attributed with 50 x 30/100
= 15 lines and xyz will be attributed with 35 lines.

Below are screenshots showing the results.
The following file.txt file has a 16 line block which is annotated with " hpkoh 30 xyz 70"
image

As a result, 11(16 x 0.7) lines of that particular block is attributed to xyz as seen below.
However, the front line has not been updated to support showing partial authorship of a block
image

A particular code block might have input from more than 1 person.
For example, another person might have resolved conflicts that arose
from a merge. Current assignment is all or nothing for any particular
line.

Let's extend the author notation to credit multiple contributors
with fields to enter a percentage representation of contribution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant