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

recursively find repos #29

Closed
ddelange opened this issue Feb 16, 2020 · 3 comments · Fixed by #58
Closed

recursively find repos #29

ddelange opened this issue Feb 16, 2020 · 3 comments · Fixed by #58

Comments

@ddelange
Copy link

ddelange commented Feb 16, 2020

When running on a folder containing multiple repos (but not being a repo itself), e.g. git-fame ~, the app errors:

fatal: not a git repository (or any of the parent directories): .git
Blame: 100%|██████████| 1/1 [00:00<00:00, 183.01file/s]
error: too many arguments given outside repository

Since I wanted the fame for all repos on my system, I had to improvise and came up (again for ~) with

git-fame --cost hour -e -M -C --sort commits `find ~ -name .git -type d -prune -exec dirname {} \; 2>/dev/null | xargs`

This sums over every repo in my home folder, which is what I wanted.

This however picks up trash repos that i forgot to remove from top level home or secondary repos like ~/.cache/pre-commit/XXX, so would actually only like git-fame ~/private_repos ~/work_repos to exclude trash thats not in one of the provided folders.

@casperdcl
Copy link
Owner

casperdcl commented Feb 16, 2020

Er so why not do that? Also you can tidy that command:

git-fame --cost hour -eMC --sort commits \
  `find ~/private_repos ~/work_repos -type d -name .git -prune`

@casperdcl casperdcl self-assigned this Feb 16, 2020
@ddelange
Copy link
Author

It's just a more natural CLI UX imo, esp for people unaccustomed to bash. Now I'll have to add a custom function in my bash_profile to emulate this behaviour, since I dont want to re-type this find command every time, as opposed to having it built-in and combinable with the easy to remember syntax of git-fame itself.

If you don't find it fitting to the bash philosophy 'do only one thing and do it well', maybe consider adding a recursive flag?

Either way I think this behaviour is a major use-case of this package :)

@casperdcl
Copy link
Owner

Either way I think this behaviour is a major use-case of this package :)

For a feature release I just made 2 days ago, nice...

@casperdcl casperdcl changed the title [feature] run git-fame for all repos in input paths recursively find repos Feb 16, 2020
casperdcl added a commit that referenced this issue Apr 20, 2021
- fixes #29
- fixes #44
casperdcl added a commit that referenced this issue Apr 20, 2021
- fixes #29
- fixes #44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants