Skip to content

Adding config for custom domains/prefixes and properly strip custom ports. #92

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

Merged
merged 1 commit into from
Oct 26, 2017
Merged

Adding config for custom domains/prefixes and properly strip custom ports. #92

merged 1 commit into from
Oct 26, 2017

Conversation

derimagia
Copy link
Collaborator

This combined all of the config into 2 items - protocol and server. They use git-config's url option to match the url. Also went back to clean up exactly how the url and server was stripped in order to fix ports.

Should fix #87. Still needs readme updates, but wanted thoughts on it

@derimagia
Copy link
Collaborator Author

@ffes can you take a look at the above to see if it works for you?

@m1guelpf
Copy link

m1guelpf commented Aug 9, 2017

What about remotes without username/host. I can have the remote github:paulirish/git-open

@derimagia
Copy link
Collaborator Author

derimagia commented Aug 9, 2017

@m1guelpf I responded to your PR here: #75

git-open Outdated

function replaceConfig() {
config=$(git config --get-urlmatch "open.$1" "$openurl")
declare -g -- "$1"="${config:-${!1}}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the stock Bash v3.2.57 that comes with macOS, the -g flag causes the following error:

../git-open: line 63: declare: -g: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird it seems to work for me on the same version. Do you mind testing without the -g? Don't think it's needed here anyway

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I duplicated it. I'll fix it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it works fine for me without the -g option.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the variable will just be in localscope sadly, it won't error but the custom var won't work

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed a fix up (I just echoed the variable and set it on the return)

@derimagia
Copy link
Collaborator Author

@nwinkler ping when you have some time!

@paulirish
Copy link
Owner

let's do it.

@paulirish paulirish merged commit e68eee6 into paulirish:master Oct 26, 2017
@paulirish
Copy link
Owner

noticed we still need readme updates. I'll put those up for review.

iblea pushed a commit to iblea/git-open that referenced this pull request Jun 17, 2024
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.

Failing gitlab tests
4 participants