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

Fix gityaw + Readme + Improve regex #5

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

BarbzYHOOL
Copy link
Contributor

@BarbzYHOOL BarbzYHOOL commented Nov 11, 2018

For free!!

@derekstavis

@BarbzYHOOL
Copy link
Contributor Author

BarbzYHOOL commented Dec 3, 2018

Ok it's bugged, i need to fix it

:fixed

@bobthecow bobthecow requested a review from derekstavis January 7, 2019 16:23
[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
Copy link
Member

@derekstavis derekstavis Jan 8, 2019

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
Copy link
Member

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
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Member

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.

@derekstavis
Copy link
Member

derekstavis commented Jan 8, 2019

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!

@BarbzYHOOL
Copy link
Contributor Author

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

README.md Outdated Show resolved Hide resolved
Co-authored-by: pinage404 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants