Repository navigation
gh repo clone should resolve paths too #8725
Description
Activity
- addedgh-reporelating to the gh repo commandrelating to the gh repo commandhelp wantedContributions welcomeContributions welcomeand removedneeds-triageneeds to be reviewedneeds to be reviewed
on Feb 23, 2024 Hey @dev-ardi, thanks for explaining your workflow here, I understand when this would be handy. I suppose the only time this might be confusing would be if the directory happened to be pointing to a
submodulebut that doesn't seem like a big deal.I've marked this
help wantedif you're interested in contributing it.If I wanted to do this, where should I start? Any concrete file to give me a heads up?
Well, the most correct solution might be to change the
FromURLfunction however that's going to impact a lot of commands and I don't have the foresight right now to know what the consequence of that will be.The simplest approach to prove this out would be to strip everything after
https://github.com/cli/clibefore passing it intoFromURL:cli/pkg/cmd/repo/clone/clone.go
Lines 105 to 106 in 590208f
} repo, err = ghrepo.FromURL(repoURL) Then adding the appropriate tests.
Is this issue still relevant?
If yes, I would like to contribute to this.@williammartin Since it's been a while and there was no activity/PR, I submitted PR #9008 for this.
And yes, touching
FromURLis not a safe approach since it's been used in various places. I've explained a bit more in the PR description.
Describe the feature or problem you’d like to solve
gh repo clone https://github.com/cli/cli/tree/trunk/internalshould clonecli/cliProposed solution
I'm often exploring a repo in github and I want to actually copy it locally so I copy the url and paste it into
git clonethen remove the paths. It would be nice if I could skip that step.