-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Update origin_changed? to ignore protocol differences #315
Conversation
Instead of hard coding the normalization for individual repository providers, it would probably be better to have a more generic solution which would work with any provider. The same normalization should also be used for |
I started that way but was a little concerned about the |
@straight-shoota I've generalized this comparison. As it turns out there are actually a lot of allowed git URL schemes. The regexes should take care of the common ones, and exactly matching origins will always work (i.e. current behavior). |
Could we use |
@Sija @RX14 Thanks for the review! I'd also missed @straight-shoota's comment about I need to add some other tests but will then push it up for you to look at. |
This updates the PR to use a new git_uri_parser, which fixes both origin_changed? and local_path issues.
I've substantially updated the PR based on feedback, and realizing that |
The implementation of private def parse_git_uri(raw_uri)
uri = URI.parse(raw_uri)
return uri if uri.absolute?
URI.parse("ssh:#{raw_uri}")
end |
Using |
Yeah, you're right. |
Looks like parse +
But that's only If the user ( |
I suppose shards should allow the exact same formats as accepted by git, so user-less scp-like format |
Yep that seems to work OK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just a few pedantic suggestions :)
Co-Authored-By: Julien Portalier <julien@portalier.com>
Co-Authored-By: Julien Portalier <julien@portalier.com>
All comments addressed. |
Thanks! |
I need an
insteadOf
git configuration and this issue has been really slowing things down, so I decided to make an attempt at fixing it. This is literally my first pushed Crystal code so any feedback is welcome!Fixes #288