obsidian-git: [Bug]: passphrase is missing for gpg key

Describe the bug

Issue

when using global git configs on linux gpg fails to run properly.

  • Expected result:
    • Git repo signs files properly without extra local settings
  • Actual result:
    • Obsidian git fails to sign the files and doesnt detect changes as a result

Relevant errors (if available)

VM110:78 Uncaught (in promise) Error: error: gpg failed to sign the data
fatal: failed to write commit object

    at Object.action (eval at <anonymous> (app.js:1), <anonymous>:2120:29)
    at PluginStore.exec (eval at <anonymous> (app.js:1), <anonymous>:2155:29)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:2594:43)
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (eval at <anonymous> (app.js:1), <anonymous>:2592:16)
    at GitExecutorChain.eval (eval at <anonymous> (app.js:1), <anonymous>:2576:44)
    at Generator.next (<anonymous>)
    at fulfilled (eval at <anonymous> (app.js:1), <anonymous>:2496:28)

Steps to reproduce

Steps to reproduce
  1. Have obsidian installed on linux either flatpak or appimage
  2. configure globally for git to sign files using your yubikey or other smartcard
  3. attempt to push changes to repo with obsidian git

Steps to solve temporarily

  1. Import global configs into local config
  2. attempt to backup using obsidian git
  3. watch it work properly

Expected Behavior

I am expecting it to work with global configurations.

Addition context

Relavent information

install type: flatpak (linux)
os: fedora silverblue
pgp setup: stored on yubikey
git version: 2.31.1
gpg version: 2.2.27

Git configs

Global (ommiting personal data)
[user]
        signingKey = [REDACTED]
        email = [REDACTED]
        name = arouzing
[commit]
        gpgsign = true
[init]
        defaultBranch = master
[credential]
        helper = store
[gpg]
        program = /usr/bin/gpg

Local (ommitting personal data)
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = git@github.com:[REDACTED]
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
[user]
      	email = [REDACTED]
        name = arouzing

Operating system

Linux

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 15 (3 by maintainers)

Most upvoted comments

I use below to bypass it

git config --local commit.gpgsign false

# Read local (if never set, can be an empty value)
git config --local commit.gpgsign ```

same here on mac

I use below to bypass it

git config --local commit.gpgsign false

# Read local (if never set, can be an empty value)
git config --local commit.gpgsign ```

does not help a lot when you actually want to authenticate with it…

Anyway, it backed up automatically now

Same issue on MacOS.

  • OS: MacOS 12.6.2
  • GIT: 2.37.1
  • GPG: 2.3.8
  • Obsidian: 1.1.9
  • Obsidian Git: 2.16.0

GPG settings are defined in global .gitconfig. GPG keychain is setup and works for me when setting up commits outside of obsidian git. The workaround of putting GPG settings into the local config works for me.

I use below to bypass it

git config --local commit.gpgsign false

# Read local (if never set, can be an empty value)
git config --local commit.gpgsign ```

does not help a lot when you actually want to authenticate with it…