obsidian-git
obsidian-git copied to clipboard
[Bug]: git not using ssh-agent when run via obsidian-git
Describe the bug
I am running ssh-agent (as provided by openssh-8.6p1) on NixOS 21.05.4719.0fd9ee1aa36 (Okapi), via keychain 2.8.5. My obsidian version is v0.13.23, and my obsidian-git plugin version is 1.21.1. My git version is 2.31.1.
Everything works as expected when using git or ssh from the command line, however the obsidian-git plugin prompts me for my key's passphrase every time it takes an action. It's become quite frustrating, but I'm not sure where the problem lies.
Relevant errors (if available)
No response
Steps to reproduce
- Install keychain and add
eval
keychain -q --confhost --ignore-missing --timeout 720 --eval KEYNAME - Open an interactive terminal and provide your ssh key when prompted
- Open an Obsidian vault with obsidian-git installed and enabled.
- Get annoyed at the frequent prompts for ssh password
Expected Behavior
I should have to enter my ssh password just once every couple of hours, per my keychain configuration.
Addition context
No response
Operating system
Linux
I have the same problem using the ssh agent from KeePass. My guess is that obidian-git is running git in a new environment and therefore the SSH_AUTH_SOCK
env is missing for git to pick up. :thinking:
EDIT: this seams to be not the case, the env is correctly passed down to simple-git. Also, spawning a child process instead of using simple-git works