Skip to content
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

What is --loc=surv? #75

Closed
movahhedi opened this issue Mar 20, 2022 · 6 comments
Closed

What is --loc=surv? #75

movahhedi opened this issue Mar 20, 2022 · 6 comments
Assignees
Labels

Comments

@movahhedi
Copy link

Hello
What is --loc=surv? I can't find any definition for it anywhere, neither in the repo, nor anywhere on the net. When to use it?

@casperdcl
Copy link
Owner

casperdcl commented Mar 21, 2022

As per https://github.com/casperdcl/git-fame#documentation "surviving lines of code" (i.e. only currently existing lines, not deleted ones)

@casperdcl casperdcl self-assigned this Mar 21, 2022
@casperdcl
Copy link
Owner

do let me know if it's not clear enough :)

@movahhedi
Copy link
Author

Thanks for answering.
If it counts lines (files?) which exist now, how is the contribution on one specific line counted? Does it just count the last rivision on that line?

Look, I'm looking for the best way to measure how much I have to pay my devs. What is your suggestion for it? Is it git fame --loc=surv -w -C? Is it even using git statics at all?

@casperdcl
Copy link
Owner

casperdcl commented Mar 21, 2022

Does it just count the last r[e]vision on that line?

--loc=surv indeed counts "just the last revision on that line." It may be useful to also include -M and -C options.

looking for the best way to measure how much I have to pay my devs.

Here be dragons 🐉 ... the --cost options can guesstimate hours & months using different models as per https://github.com/casperdcl/git-fame#faqs - but note:

  • there's no way to distinguish between refactoring (presumably high value) & reformatting (presumably lower value)
  • generated code (e.g. package-lock.json) is probably better measured by number of commits, while functional code (e.g. train.py) is probably better measured by number of lines
  • deletions --loc=del (removing bad code) and past insertions --loc=ins (no longer surviving lines which nevertheless influenced the ideas behind the current code) could also both be useful
  • one line of code may be more valuable than 100. Quality can only be measured by a human
  • reviewing other people's code may be valuable but doesn't show up in Git history
  • ... the list of caveats goes on

I would at best use git fame as one of many many ways to help gauge the true value of contributions. One possible strategy is getting people to review each other's work if you feel incapable of reviewing it yourself. I would not suggest paying people solely based on number/rate of commits/lines.

@movahhedi
Copy link
Author

I truly value your answer, It is indeed very helpful. Thanks 😊

@movahhedi
Copy link
Author

movahhedi commented Mar 23, 2022

--loc=surv counts all files including binary files (like image files), but --loc=ins,del doesn't? Is there an option to automatically exclude these files? (without using --excl for every single extension)
How is the surviving code 50879 lines, but the total loc for ins,del 30139?
I tried --warn-binary for it but it didn't seem to do anything.

F:\xampp\htdocs\test>git fame --loc=surv -t
Processing: 100%|███████████████████████████████████████████████████████████████| 77/77 [00:11<00:00,  6.49file/s]
Total .css: 3866
Total .gitignore: 1
Total .html: 56
Total .jpeg: 349
Total .jpg: 35950
Total .js: 658
Total .php: 4057
Total .png: 5145
Total .sql: 413
Total .svg: 384
Total commits: 181
Total ctimes: 1463
Total files: 112
Total loc: 50879

F:\xampp\htdocs\test>git fame --loc=ins,del -t
Processing: 100%|█████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  1.25repo/s]
Total .css: 8861
Total .gitignore: 3
Total .html: 56
Total .js: 982
Total .json: 72
Total .md: 172
Total .php: 16035
Total .sql: 3906
Total .svg: 12
Total .txt: 40
Total commits: 181
Total ctimes: 397
Total files: 144
Total loc: 30139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants