Skip to content

SSH Commit signing not working - unknown shorthand flag: 'U' in -U #1803

@BigGold1310

Description

@BigGold1310

What happened?
While trying to sign a git commit with an SSH key the following error was encountered:

error: ?[0;1;37m18:58:54 ?[0m?[0;1;31merror ?[0mTry using the --debug flag to see a more verbose output
?[0;1;37m18:58:54 ?[0m?[0;1;31mfatal ?[0munknown shorthand flag: 'U' in -U

fatal: failed to write commit object

What did you expect to happen instead?
A commit gets successfully signed with an SSH key using the forwarded ssh agent.

How can we reproduce the bug? (as minimally and precisely as possible)

My devcontainer.json:

{
  "name": "Development Container",
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu"
}

Local Environment:

  • DevPod Version: v0.6.15
  • Operating System: mac
  • ARCH of the OS: ARM64

DevPod Provider:

  • Local/remote provider: docker

Anything else we need to know?
DevPod ~/.gitconfig:

[user]
        name = User Name
        email = user@email.org
[credential]
        helper = !'/usr/local/bin/devpod' agent git-credentials --port 12049
[gpg "ssh"]
        program = devpod-ssh-signature
[gpg]
        format = ssh
[user]
        signingkey = ssh-ed25519 A<truncated>s

Trying to sign a commit results in the error:

$ git commit --amend -s -S
error: ?[0;1;37m18:58:54 ?[0m?[0;1;31merror ?[0mTry using the --debug flag to see a more verbose output
?[0;1;37m18:58:54 ?[0m?[0;1;31mfatal ?[0munknown shorthand flag: 'U' in -U

fatal: failed to write commit object

Running git in trace mode:

$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git commit --amend -s -S 
19:08:17.546494 git.c:479               trace: built-in: git commit --amend -s -S
hint: Waiting for your editor to close the file... 19:08:17.564423 run-command.c:666       trace: run_command: GIT_INDEX_FILE=.git/index 'code --wait' /workspaces/zion/.git/COMMIT_EDITMSG
19:08:17.564437 run-command.c:758       trace: start_command: /bin/sh -c 'code --wait "$@"' 'code --wait' /workspaces/zion/.git/COMMIT_EDITMSG
19:08:20.625044 run-command.c:666       trace: run_command: devpod-ssh-signature -Y sign -n git -f /tmp/.git_signing_key_tmpvLhjbc -U /tmp/.git_signing_buffer_tmppwGIOt
19:08:20.625103 run-command.c:758       trace: start_command: /usr/local/bin/devpod-ssh-signature -Y sign -n git -f /tmp/.git_signing_key_tmpvLhjbc -U /tmp/.git_signing_buffer_tmppwGIOt
error: ?[0;1;37m19:08:20 ?[0m?[0;1;31merror ?[0mTry using the --debug flag to see a more verbose output
?[0;1;37m19:08:20 ?[0m?[0;1;31mfatal ?[0munknown shorthand flag: 'U' in -U

fatal: failed to write commit object

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions