Conversation
|
Hi, thank you for your contribution! Would you think that this feature is best addressed by allowing to simply specify a clone directory as suggested in #653? I feel like that the flag proposed here opts into an overly specific behavior that I'm not looking forward to having to maintain, but that an additional argument could let people wrap this behavior with their scripts if they needed to; for example ghc() {
local repo="${1?}"
gh repo clone "$repo" $repo"
}
ghc owner/repo
cd owner/repoIf so, would you be open to adding that feature instead? |
|
@mislav thanks for taking the time to look over this. I understand the hesitation to commit to overly specific behavior. I wonder if consolidating the I agree that in the simplest case of For instance, when using a full URL like And if |
|
I also included a possible fix for #653. It's not the prettiest implementation, but it works. It essentially parses the extra args to find any orphaned ones, Ideally we could somehow leverage git's actual command line arg parsing, maybe through something like this. But this is pretty much my first go code, so I wasn't really sure how to go about doing that. I'm going to split this PR real quick so that work stands on its own. |
That's a good point. Maybe in the future we can contemplate passing a "template" argument to designate the clone target: Here, the placeholder values would get filled in with resolved owner and repo names. However, I think it's still premature to discuss such a feature, and I would rather that we focus on a straightforward, static clone destination argument for parity with Thank you! |
Add an option
--clone-nestedto clone the repo toowner/repo(naming things is hard, I'm open to suggestions).This helps for some use cases of #653 where people may want to keep their source directory mirroring the org structure. Some tools like ghq do this as well.