Comments (6)
In your case, ghq traverses all repositories three times, and I'll explain why:
Firstly, before getting or updating a repository, ghq traverses all repositories to determine if a specific repository exists.
Secondly, after getting or updating a repository, ghq attempts to match the repository with the provided URL. However, it matches the repository's subpath, which results in not finding a match.
Lastly, ghq parses the URL provided by the user and uses the parsed information to match the repository, where it succeeds in finding a match.
Overall, the execution time of the ghq get -l command is approximately three times longer than the ghq get command.
from ghq.
Thank you for the explanation.
However, don't you feel 7 secs is reasonable? Does that depend on the number of repository I've already checked-out?
from ghq.
I have created a PR here to ensure that it scans all repositories only once in your scenario. By the way, how many projects do you have? I have dozens of projects, and it only takes me 40 milliseconds to scan them.
from ghq.
Thanks.
I would say I have more, but how can I count that?
Due to groups in GitLab, I can't just count folders.
It should be around ~60 maximum, so not something very big.
Is ghq
affected by other things stored in $GHQROOT
root? I just discovered I have pkg/mod
folder from a golang
env I've setup some times ago.
![image](https://private-user-images.githubusercontent.com/1970922/324564147-7b3ce4b2-381b-435e-9997-3b52d9155107.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2NzA5NTUsIm5iZiI6MTcyMTY3MDY1NSwicGF0aCI6Ii8xOTcwOTIyLzMyNDU2NDE0Ny03YjNjZTRiMi0zODFiLTQzNWUtOTk5Ny0zYjUyZDkxNTUxMDcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjJUMTc1MDU1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDg0NDgwNDY0YzFlMmRlNzNhOTAyZGEzZmZmNTlkMjQ5YTc5OTVhOTAxYTVkYWUxOGRlYmQ0MDg4NDI1NjNiZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.P9Y-NQz3QXqLrq4ziPnIaWYRIHGQMArTeHp1uMu_fVs)
And it contains… ~60k folders 😅.
from ghq.
You can use this command to display the projects:
ghq root --all | xargs -I {} fd --type d --max-depth 4 --hidden .git {} | sed 's/\/\.git//'
And, I think pkg
should not under the workspace 🤔
from ghq.
![image](https://private-user-images.githubusercontent.com/1970922/324572988-8485ece9-520a-44f2-9f76-0f24ed03d6f2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2NzA5NTUsIm5iZiI6MTcyMTY3MDY1NSwicGF0aCI6Ii8xOTcwOTIyLzMyNDU3Mjk4OC04NDg1ZWNlOS01MjBhLTQ0ZjItOWY3Ni0wZjI0ZWQwM2Q2ZjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjJUMTc1MDU1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTE3ODRkZTg4NDI4ZGI1ODg1MDEzNjA4N2Y5ZWI1NmM3MTE1ZjIxODM0MjUzNWQxMDg0NTRkY2E3ZTVkZTU1MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.eZI8k4PTvmlzwCiHyu_usl-KLJ1cnGWfz1nBIBwgZ5c)
I think --max-depth 4
reduces the list, because I have groups inside group with GitLab, then we filter some.
But it should be approximatively that…
about pkg
, I'll give it a try tomorrow by (re)moving it somewhere else and see if it's fater.
from ghq.
Related Issues (20)
- Disable colors
- Request: binary release for arm64(aarch64) Linux HOT 2
- Feature Request: Add MacPorts package
- Feature request: Optional wait between invokations of git
- ghq version 1.3.0-1 does not build anymore. HOT 1
- support breezy HOT 1
- Request: ability to configure default user/org name HOT 1
- Distribute via PPA for ubuntu based distros HOT 1
- feat: 'ghq goto' command to find and go to any repo's local location, 'ghq get -' command to re-do the operation on the last used repo like 'cd - or git switch - HOT 1
- [Feature] Support scalar
- Feature request: print the directory path to stdout on `ghq get` HOT 2
- ghq change origin
- Feature request: support partial clone HOT 1
- Feature request: ghq `clone` command HOT 1
- Clone from gitlab.com via ssh fails HOT 3
- Feature request: List uncommitted changes and stashes within all repos
- Is it possible to simplify or map to a specific child directory?
- gitconfig ghq by host isn't working
- `ghq get` did not entirely clone SVN repository
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghq.