git-metrics icon indicating copy to clipboard operation
git-metrics copied to clipboard

addition to "open branch" to include number of lines changed.

Open sofusalbertsen opened this issue 7 years ago • 4 comments

In addition to showing the amount of time, a given commit haven't been integrated, one could also measure how much (as in changed lines of code) change is laying on a given branch:

git log --numstat --pretty="%H" commit1..commit2 | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}'

sofusalbertsen avatar Jan 30 '19 13:01 sofusalbertsen

Snippet taken from: https://stackoverflow.com/questions/2528111/how-can-i-calculate-the-number-of-lines-changed-between-two-commits-in-git

sofusalbertsen avatar Jan 30 '19 13:01 sofusalbertsen

Thanks @sofusalbertsen I also think that the size of a branch would be interesting, with multiple measures.

Using diff might be a better choice then log? Are we interested in the size of the potential merge or are we interested in the number of times lines are changed, even the same line?

We should also be aware that to many stats will make it harder to find what is important for the user.

I think still that age is more important then "size".

Neppord avatar Feb 05 '19 08:02 Neppord

I see this as an army knife of utills that can give you insights, where each metric should have a reason/description about what this metric can tell you. But maybe this is scope creep for your repo's intention?

sofusalbertsen avatar Feb 05 '19 09:02 sofusalbertsen

No, I don't think it's scope creep. I thinking it's a good idea and that we need to add it as new command or a flag on a the existing command.

This could also be a good oppertunity to make all the different endpoints "true" git commands by giving them the correct name. Like "git-branch-diffsize" or other?!

Neppord avatar Feb 05 '19 09:02 Neppord