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

Should gh.nvim config.prefer_https_remote use gh config? #28

Closed
dlvhdr opened this issue May 21, 2022 · 11 comments
Closed

Should gh.nvim config.prefer_https_remote use gh config? #28

dlvhdr opened this issue May 21, 2022 · 11 comments

Comments

@dlvhdr
Copy link
Contributor

dlvhdr commented May 21, 2022

The gh config already stores the user preference for https/ssh.
Do you think you should respect that as well? as all the other actions use gh under the hood I'm assuming.

@ldelossa
Copy link
Owner

Aha!

🖭  gh config list
git_protocol=ssh
editor=
prompt=enabled
pager=
http_unix_socket=
browser=

That would be pretty cool, and probably the right thing to do, so you're thinking, on gh.nvim startup, do something like:

🖭  gh config get git_protocol
https

and then automatically set the git remote accordingly?

@dlvhdr
Copy link
Contributor Author

dlvhdr commented May 21, 2022

Yes I think thats the approach

@ldelossa
Copy link
Owner

Would you want to take on that PR? Seems relatively straight forward.

@dlvhdr
Copy link
Contributor Author

dlvhdr commented May 21, 2022

Yeah I can do that

@ldelossa
Copy link
Owner

Cool, we may want an "auto" flag in the "prefer_https_remotes" config value, where we dynamically look it up. This then still allows the user to force "ssh" or "https" if they want to. Maybe its useful?

@dlvhdr
Copy link
Contributor Author

dlvhdr commented May 21, 2022

My intuition is that a user wouldn't need to define a different protocol for gh.nvim that is different than gh.
I would add it in the future if there's an interest but I could be wrong here

@ldelossa
Copy link
Owner

ldelossa commented May 21, 2022

@David-Kunz in issue #15 you had to flip the "prefer_https_remote" flag in your private repo.

In this issue we are trying to determine if we looked at the "gh config list" command and set the remote type with the setting in there, would it have set the correct remote protocol for you?

Could you run that command in your private repo where you're using the "prefer_https_remote" flag and tell us the value of the "git_protocol" config.

@David-Kunz
Copy link
Contributor

Hi @ldelossa,

When I execute gh config list, the value is gh_protocol=https.

Best regards,
David

@ldelossa
Copy link
Owner

Cool, thanks @David-Kunz.

a little unscientific @dlvhdr but seems like on all our systems the gh cli matches the git protocol that works. Just wanted to make sure.

@ldelossa
Copy link
Owner

Closed! Thanks again @dlvhdr

@ldelossa
Copy link
Owner

Thank occurred just now:

~/git/vim/litee-gh-testing remotes/litee-gh_ldelossa/litee-gh-testing/branch-1
🖭  gh config list
git_protocol=ssh
editor=
prompt=enabled
pager=
http_unix_socket=
browser=

~/git/vim/litee-gh-testing remotes/litee-gh_ldelossa/litee-gh-testing/branch-1
🖭  gh config get git_protocol
https

Weird lol. I manually set it to get it to work again.

~/git/vim/litee-gh-testing main
🖭  gh config set git_protocol ssh

~/git/vim/litee-gh-testing main
🖭  gh config get git_protocol    
ssh

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

No branches or pull requests

3 participants