wert007 / commit-analyzer

Gets the time somebody worked on something from `git log`
MIT License
1 stars 1 forks source link

[Question] Loc as the Difference Between Insertions and Deletions? #12

Closed kevinmatthes closed 2 years ago

kevinmatthes commented 2 years ago

Are you sure that the loc is calculated from the difference between the insertions and deletions?

Not only my version of Git considers the loc the sum of insertions and deletions, also GitHub does. For instance, go to the list of changed files from the latest Pull Request and hover the number on the left-hand side of src/main.rs. (The README only had insertions, so that would be boring.) GitHub shows to me then: "45 changes: 24 additions & 21 deletions."

Did I misunderstand the purpose of the Loc struct or might that really be a candidate for a bugfix?

wert007 commented 2 years ago

Loc stands for lines of code, so every commit can either increase or decrease the total number of lines of code.

The Loc struct was used to show the development of a software project over time. We choose the lines of code as a metric and used git to display them per day.

So no, this is not a bug.

kevinmatthes commented 2 years ago

Okay, thank you.

I am about to add some documentation to the code, I will add your explanation to the documentation.