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

ghq list is slow when a root directory contains directories which are not managed by any VCS. #323

Open
shotat opened this issue May 31, 2021 · 3 comments

Comments

@shotat
Copy link

shotat commented May 31, 2021

ghq list is slow when a root directory contains directories which are not managed by any VCS.

It seems that ghq list walks directory until it find a VCS configuration like .git directory.
It would be helpful if ghq could give some kind of warning when it hits directories which are not managed by VCSs.

Versions

ghq -v
ghq version 1.2.1 (rev:dd139fb)
@yhkaplan
Copy link

Maybe a setting to ignore all directories without a specific VCS subdir like .git would be nice

@acomagu
Copy link

acomagu commented Apr 17, 2022

Quick alternative: find $(ghq root) -maxdepth 4 -type d -name .git -printf '%P\n' | xargs -n1 dirname

(Change 4 to your suitable value)

@craftzdog
Copy link

Quick alternative: find $(ghq root) -maxdepth 4 -type d -name .git -printf '%P\n' | xargs -n1 dirname

Saved my day!

yujinyuz added a commit to yujinyuz/dotfiles that referenced this issue May 25, 2024
When the list of repositories in my ghq source directory got large, it
was getting extremely slow when performing a clone[^1][^2].

It turns out that I have a lot of directories that are not managed by
git especially within my work folder. I was able to figure this out
after moving out the _work_ directory outside the `~/Sources` dir.

I found https://github.com/siketyan/ghr and it seems to be fast because
it doesn't check `.git` folders (which I'm fine with)

Refs:

[^1]: x-motemen/ghq#323
[^2]: x-motemen/ghq#379
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants