Menu

#1077 Team projects fail to commit with enabled signing

5.8
closed-fixed
git (13)
5
2023-09-27
2021-10-28
No

With OmegaT 5.5 and earlier, the program ignored a set user.signinkey values in the global (or local) Git configuration. Commits were never signed, even with a key set.
Starting with 5.6 this results in an exception, since OmegaT honors the value being set, yet isn't able to talk to the associated tools to sign the commit (but it won't skip signing either).

Using regular command line git results in the proper password prompts being shown.

Windows 11 x64
gpg4win/gpg v2.2.28

Reproduction:

  • Use any OmegaT team project backed by a git repository.
  • Create/import/use a GPG key pair (the key having a passphrase).
  • Set user.signingkey to the key's identifier.
  • Set user.program to gpg.
  • Set gpg.program to the full path of gpg.exe.
  • (In my case all gpg programs are in the global PATH, too.)
  • Once you try to save any changes to the team project, the commit to the repository will fail with org.eclipse.jgit.api.errors.ServiceUnavailableException: Signing service is not available.

Global .gitconfig:

[user]
    name = Mario Liebisch
    email = me@example.com
    signingkey = 0123456789ABCDEF
    program = gpg
[gpg]
    program = C:\\Program Files (x86)\\GnuPG\\bin\\gpg.exe

Workaround for those with the same issue:
Remove the key globally or set your local OmegaT repository's value commit.gpgsign to false.
This will prevent signing for the OmegaT repository, while keep it intact for everything else.

1 Attachments

Related

Bugs: #1075

Discussion

  • Hiroshi Miura

    Hiroshi Miura - 2021-11-04

    GpgSigner abstract class has been supported from jGit 5.3.
    OmegaT 5.5 uses jGit 4.11.8, and OmegaT 5.6 uses jGit 5.11.1

    It is why the behavior changed for git signing.
    Unfortunately OmegaT 5.6 does not have any GpgSigner related code, so the exception might be raised.

     

    Last edit: Hiroshi Miura 2021-11-04
  • Hiroshi Miura

    Hiroshi Miura - 2021-11-04

    This seems make Gpg signing working

    diff --git a/build.gradle b/build.gradle
    index fbcbde2b3..78ffd44c8 100644
    --- a/build.gradle
    +++ b/build.gradle
    @@ -169,6 +169,8 @@ dependencies {
             implementation 'org.bouncycastle:bcprov-jdk15on:1.69'
             // For ssh agent support of jsch, Java16+ or junixsocket
             implementation 'com.kohlschutter.junixsocket:junixsocket-core:2.4.0'
    
    +        // For gpg signing
    +        implementation 'org.eclipse.jgit:org.eclipse.jgit.gpg.bc:5.11.1.202105131744-r'
             implementation 'org.tmatesoft.svnkit:svnkit:1.8.14'
    
             // Team project conflict resolution
    
     git log --show-signature -1
    commit d27518b5483b12c550f52cc87a4243db470e0e68 (HEAD -> master, origin/master)
    gpg: Signature made Thu Nov  4 21:37:45 2021 JST
    gpg:                using RSA key 2C76F2EF91D05AB2989B1B139014DA25D2433AE3
    gpg:                issuer "miurahr@linux.com"
    gpg: Good signature from "Hiroshi Miura <miurahr@linux.com>" [ultimate]
    Author: Hiroshi Miura <miurahr@linux.com>
    Date:   Thu Nov 4 21:37:16 2021 +0900
    
        Translated by miurahr
    
     

    Last edit: Hiroshi Miura 2021-11-04
  • Hiroshi Miura

    Hiroshi Miura - 2021-11-04
     
    • Hiroshi Miura

      Hiroshi Miura - 2021-11-09

      I've added a preference option and UI to select whether omegat sign a commit or not.

       
      • Hiroshi Miura

        Hiroshi Miura - 2021-12-11

        I've dropped preference option, and see git config whether sign or not.

         
  • Hiroshi Miura

    Hiroshi Miura - 2022-09-17
    • assigned_to: Hiroshi Miura
    • Group: 5.6 --> 5.8
     
  • Hiroshi Miura

    Hiroshi Miura - 2022-09-17
    • status: open --> open-fixed
     
  • Hiroshi Miura

    Hiroshi Miura - 2023-09-27
    • status: open-fixed --> closed-fixed
     
  • Hiroshi Miura

    Hiroshi Miura - 2023-09-27

    released 6.0

     

Log in to post a comment.

MongoDB Logo MongoDB