4 ms·
This is great. I do this sort of git-blame accounting to track how much code is written by AI versus humans in each release of my app. My "blame script" has be
by anotherpaulg 2y ago
This is great. I do this sort of git-blame accounting to track how much code is written by AI versus humans in each release of my app.
My "blame script" has been slowing down as the repo size increases. I was just about to add caching, like you have.
Have you thought about adding the ability to limit the stats based on a set of file patterns? Perhaps like this, where the file follows gitignore conventions?
git-who table -include-file <fname>
git-who table -ignore-file <fname>
I tried to quickly add this functionality but unfortunately I don't know go.
- weebst 2y agoThat's a neat idea, I can see how it'd be useful. If you have a shell that supports extended globbing, you could do something like: $ git who table */**/*.go That works for me using Bash. I believe all that's happening here is that Bash is expanding the globs and passing a long list of individual filepaths as arguments to git who. Git who then passes them to git log so that it only tallies the commits you'd get by running: $ git log */**/*.go
- JadeNB 2y ago> $ git who table */**/*.go I might have my globbing syntax wrong, but I think that `*/**/*.go` is the same as `**/*.go` unless you have `*.go` files in the working directory.
- anotherpaulg 2y agoYup. It’s a complex enough set of in/excludes that I think that would get unwieldy for my use case. Details here: https://github.com/Aider-AI/aider/blob/main/scripts/blame.py https://github.com/Aider-AI/aider/blob/main/scripts/blame.py Again, nice work on your tool. I’ll spend some more time trying to harness it for my need.
- weebst 2y agoThank you very much!
- reubenmorais 2y agoGit natively supports excludes in all pathspecs, e.g. `git log -- ':!generated/'` to exclude files in the `generated/` folder from showing up in the log.