Skip to content

Adding logging/tracing information #18

@pjbgf

Description

@pjbgf

Hey Folks!

Fellow go-git maintainer here. In the past, we had quite a few issues where users struggled to understand why a given SSH connection was not established successfully. Those tended to be a bit of a pain to investigate, and due to that we recently made a few changes in some of our upstream dependencies (which we vendored) in order to attain a level of trace information that could enable end-users to self troubleshoot. The output looks like so:

$ GIT_TRACE_SSH=true go run _examples/clone/main.go git@github.com:go-git/go-git /tmp/go-git

19:09:14.134147 common.go:43: ssh: Using default auth builder (user: git)
19:09:14.134193 sshagent.go:42: ssh: net.Dial unix sock /tmp/ssh-XXXXXXULYg1c/agent.6427
19:09:14.134224 auth_method.go:224: ssh: ssh-public-key-callback user=git
19:09:14.134317 auth_method.go:345: ssh: found key: sk-ssh-ed25519@openssh.com SHA256:otsLd7qnCx9TrhUfIPCiP2cbk3Rkb5gtxyUJy2Zeheo
19:09:14.134323 auth_method.go:255: ssh: known_hosts sources [/home/levi/.ssh/known_hosts /etc/ssh/ssh_known_hosts]
19:09:14.134330 auth_method.go:260: ssh: filtered known_hosts sources [/home/levi/.ssh/known_hosts]
19:09:14.134533 auth_method.go:255: ssh: known_hosts sources [/home/levi/.ssh/known_hosts /etc/ssh/ssh_known_hosts]
19:09:14.134540 auth_method.go:260: ssh: filtered known_hosts sources [/home/levi/.ssh/known_hosts]
19:09:14.134577 common.go:155: ssh: host key algorithms [ssh-ed25519]
19:09:14.458332 auth_method.go:330: ssh: hostkey callback hostname=github.com:22 remote=20.26.156.215:22 pubkey="ssh-ed25519 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU"

From a xanzy/ssh-agent perspective, the changes are here and here.

Would you be open to have some level of logging in place around that functionality, and enable consumers of your library to toggle that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions