-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix gityaw + Readme + Improve regex #5
base: master
Are you sure you want to change the base?
Conversation
Also made the regex code more readable for both functions.
Ok it's bugged, i need to fix it :fixed |
[author]: https://github.com/{{USER}} | ||
[contributors]: https://github.com/{{USER}}/plugin-gityaw/graphs/contributors | ||
[author]: https://github.com/derekstavis | ||
[contributors]: https://github.com/BarbzYHOOL/plugin-gityaw/graphs/contributors |
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.
This needs to be under github.com/oh-my-fish/
|
||
|
||
[mit]: https://opensource.org/licenses/MIT | ||
[author]: https://github.com/{{USER}} | ||
[contributors]: https://github.com/{{USER}}/plugin-gityaw/graphs/contributors | ||
[author]: https://github.com/derekstavis |
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 for fixing this 😅
@@ -0,0 +1,2 @@ | |||
- Turn githublab and gitlabhub into one function that either switch from one to the other automatically (unless bitbucket is added but I don't really use bitbucket) | |||
- Turn gityaw and gitunyaw into one function that switches from https to ssh |
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.
Not sure if it should be a single function -- They perform different jobs
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.
i mean "gityaw" makes 0 sense to me as a name and i often am typing "ungityaw" instead of "gitunyaw" and thought that "gityaw" could do everything all at once depending on the remote
set regex 's/git@\(.*\):\(.*\)\/\(.*\)\.git/https:\/\/\1\/\2\/\3.git/' | ||
echo $ssh | sed -e "$regex" | read -l https | ||
## Replace remote with sed (extended regexp) then assign to variable $https | ||
echo $ssh | sed -E "s~git@(.*):(.*)/(.*)\.git~https://\1/\2/\3.git~" | read -l https |
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.
I have intentionally avoided sed -E
as it has compatibility problems between BSD and GNU.
set regex 's/https:\/\/\(.*\)\/\(.*\)\/\(.*\)\(.git\)*/git@\1:\2\/\3.git/' | ||
echo $https | sed -e "$regex" | sed -e 's/\.git\.git$/\.git/' | read -l ssh | ||
## Replace remote with sed (extended regexp) then assign to variable $ssh | ||
echo $https | sed -E "s~https://([^\/]+)/([^\/]+)/([^\/\.\n\r]+).*~git@\1:\2\/\3.git~" | read -l ssh |
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.
The same here, sed -E
has compatibility issues, I would rollback this one.
First of all, sorry for taking so much time to review this one. Second, thanks for the fixes and additions, they are surely very valuable! I have left some review comments that we need to address before merging! |
Well if it has some issues, then let's close it. I spent many hours on that shit sed regex, and don't want to deal with it anymore xD |
Co-authored-by: pinage404 <[email protected]>
For free!!
@derekstavis