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

Libgit2 usability issues #17586

Merged
merged 3 commits into from
Jul 28, 2016
Merged

Libgit2 usability issues #17586

merged 3 commits into from
Jul 28, 2016

Conversation

Keno
Copy link
Member

@Keno Keno commented Jul 23, 2016

This is WIP, because the test fails non-deterministically and I've been unable to debug (was trying to use rr to figure out what's happening, but it crashes rr). Just putting this up so people can see what part of #17541 is already done. Will get back to fixing the test a little later.

@@ -59,6 +59,8 @@ function credentials_callback(cred::Ptr{Ptr{Void}}, url_ptr::Cstring,
# parse url for schema and host
urlparts = match(urlmatcher, url)
schema = urlparts.captures[1]
urlusername = urlparts.captures[4]
urlusername == nothing && (urlusername = "")
Copy link
Contributor

Choose a reason for hiding this comment

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

=== nothing

@tkelman tkelman mentioned this pull request Jul 26, 2016
@@ -59,6 +59,8 @@ function credentials_callback(cred::Ptr{Ptr{Void}}, url_ptr::Cstring,
# parse url for schema and host
urlparts = match(urlmatcher, url)
schema = urlparts.captures[1]
urlusername = urlparts.captures[4]
Copy link
Member

Choose a reason for hiding this comment

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

usually, username from url is git for git+ssh protocol. You can use username_ptr parameter to get it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, not sure what you're suggesting. The urlusername only ever gets used by https. Are you saying that libgit2 is already extracting this, so we should just load it from username_ptr?

Copy link
Member

@wildart wildart Jul 28, 2016

Choose a reason for hiding this comment

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

ok, for https username_ptr is NULL

@kshyatt kshyatt added the libgit2 The libgit2 library or the LibGit2 stdlib module label Jul 26, 2016
@Keno Keno force-pushed the kf/libgit2usability branch from 8eb5ce2 to ff75ca4 Compare July 27, 2016 18:45
@Keno Keno changed the title WIP: Libgit2 usability issues Libgit2 usability issues Jul 27, 2016
@Keno Keno force-pushed the kf/libgit2usability branch from ff75ca4 to c652593 Compare July 27, 2016 18:49
@Keno
Copy link
Member Author

Keno commented Jul 27, 2016

I've rebased out the test and will open that as a separate pull request.

@@ -114,15 +116,23 @@ function credentials_callback(cred::Ptr{Ptr{Void}}, url_ptr::Cstring,
ENV["SSH_KEY_PATH"]
else
keydefpath = creds[:prvkey, credid] # check if credentials were already used
if keydefpath !== nothing && !isusedcreds
keydefpath == nothing && (keydefpath = "")
Copy link
Contributor

Choose a reason for hiding this comment

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

=== nothing

@Keno Keno force-pushed the kf/libgit2usability branch 2 times, most recently from 2b7f6ca to b4b2b4c Compare July 27, 2016 19:02
Keno added 3 commits July 27, 2016 16:41
Encrypted keys have `Proc-Type: 4,ENCRYPTED`, so check for that before requiring a
passkey. Part of #17541.
Only prompt for a different private key. If authentication with the first key fails.
This can be a little annoying if one wants to use a different private key, but the
default one is encrypted, so it queries for a password, without asking for the key first.
However, in that case, one probably wants to use the environment variables or the ssh
agent anyway, so I'm not too concerned.
@Keno Keno force-pushed the kf/libgit2usability branch from b4b2b4c to 7ba3ebd Compare July 27, 2016 20:41
@Keno Keno merged commit e717ded into master Jul 28, 2016
@Keno Keno deleted the kf/libgit2usability branch July 28, 2016 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants