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

Support branch/tag via @ syntax #347

Merged
merged 2 commits into from
Feb 22, 2023
Merged

Conversation

NathanBaulch
Copy link
Contributor

Thanks for the neat tool.
I thought it would be nice if @ syntax was supported for branch/tag just like go get does. I did eventually find the --branch option but @ seems appropriate given this tool was originally inspired by the Go tooling.

This also has the advantage of allowing you to choose different branches when getting multiple repos at once, eg:

ghq get -P x-motemen/ghq@gotesplit men/gore@main NathanBaulch/[email protected]

I don't know about the other supported VCS providers but you can't directly clone a specific commit SHA in Git, so this go get scenario wouldn't be supported.

This implementation is pretty naive and will break if the repository URL contains an @ symbol for some reason. If this feature sounds useful then maybe we can come up with something more robust, perhaps by validating the branch/tag name.

Cheers.

@Songmu
Copy link
Member

Songmu commented Sep 27, 2022

Sorry for the delay in responding. I think it's a nice feature, and I think it's a major technique, since the same revision specification is done in GitHub Actions as well as Go.
Let me think about it a bit.

@furushchev
Copy link

@Songmu Hello. This is a very nice addition. What is the current status on it?

@Songmu Songmu merged commit 515ba78 into x-motemen:master Feb 22, 2023
@github-actions github-actions bot mentioned this pull request Feb 22, 2023
@Songmu Songmu added minor and removed tagpr:minor labels Feb 22, 2023
@Songmu
Copy link
Member

Songmu commented Feb 22, 2023

Thank you. I merged it and released it as v1.4.0.

@BlueGone
Copy link

This change introduced an important regression for my use case (and I suppose the use case of many people).
Indeed, I clone my projects with ssh, so all my cloning addresses contain an @ (example : ghq get [email protected]:x-motemen/ghq.git)
I do not know how to conciliate this new feature, and the cloning with ssh, but we should do something about it.

@Songmu
Copy link
Member

Songmu commented Feb 22, 2023

@BlueGone That is exactly correct. Sorry for the inconvenience. Thanks for the great report. I will create a correction now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants