eclipse-egit / egit

EGit, the git integration of Eclipse IDE
https://www.eclipse.org/egit/
Eclipse Public License 2.0
18 stars 7 forks source link

Ament, Add Signed-off-by, Add Change-Id and SignCommit deactivated after commit. #52

Open Sduniii opened 2 months ago

Sduniii commented 2 months ago

Version

6.8.0

Operating System

Linux/Unix, Windows

Eclipse version

2024-03

Bug description

"Commit Message" options deactivated after commit fail. This results, for example, in multiple added Change-Ids after activating the box again.

https://github.com/eclipse-egit/egit/blob/b01eccd78378ed9b3dcaf5833602d122daea4c1b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java#L4864

Actual behavior

Ament, Add Signed-off-by, Add Change-Id and SignCommit deactivated after commit. This results in unexpected effects.

Expected behavior

Nothing unchecked after a commit fail.

Relevant log output

No response

Other information

No response

msohn commented 2 months ago

If commit failed there should be some errors in the Eclipse error log. Please check the error log and post them here.

Sduniii commented 2 months ago

I intentionally entered my password incorrectly here:

org.eclipse.jgit.api.errors.JGitInternalException: Failed to parse secret key file xxx.key. Is the entered passphrase correct? at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgSigner.signObject(BouncyCastleGpgSigner.java:211) at org.eclipse.jgit.api.CommitCommand.sign(CommitCommand.java:336) at org.eclipse.jgit.api.CommitCommand.call(CommitCommand.java:283) at org.eclipse.egit.core.op.CommitOperation.commit(CommitOperation.java:259) at org.eclipse.egit.core.op.CommitOperation$1.run(CommitOperation.java:211) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2448) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2473) at org.eclipse.egit.core.op.CommitOperation.execute(CommitOperation.java:220) at org.eclipse.egit.ui.internal.commit.CommitJob.run(CommitJob.java:135) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Caused by: org.bouncycastle.openpgp.PGPException: Failed to parse secret key file xxx.key. Is the entered passphrase correct? at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyLocator.findSecretKeyForKeyBoxPublicKey(BouncyCastleGpgKeyLocator.java:521) at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyLocator.findSecretKey(BouncyCastleGpgKeyLocator.java:400) at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgSigner.locateSigningKey(BouncyCastleGpgSigner.java:120) at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgSigner.signObject(BouncyCastleGpgSigner.java:146) ... 9 more Caused by: org.bouncycastle.openpgp.PGPException: Cannot create cipher to decrypt: mac check in OCB failed at org.eclipse.jgit.gpg.bc.internal.keys.OCBPBEProtectionRemoverFactory$1.recoverKeyData(OCBPBEProtectionRemoverFactory.java:112) at org.eclipse.jgit.gpg.bc.internal.keys.SExprParser.extractData(SExprParser.java:430) at org.eclipse.jgit.gpg.bc.internal.keys.SExprParser.processRSASecretKey(SExprParser.java:724) at org.eclipse.jgit.gpg.bc.internal.keys.SExprParser.parseSecretKey(SExprParser.java:217) at org.eclipse.jgit.gpg.bc.internal.keys.SecretKeys.readSecretKey(SecretKeys.java:152) at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyLocator.attemptParseSecretKey(BouncyCastleGpgKeyLocator.java:180) at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyLocator.findSecretKeyForKeyBoxPublicKey(BouncyCastleGpgKeyLocator.java:516) ... 12 more Caused by: javax.crypto.AEADBadTagException: mac check in OCB failed at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486) at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher$AEADGenericBlockCipher.doFinal(Unknown Source) at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(Unknown Source) at java.base/javax.crypto.Cipher.doFinal(Cipher.java:2190) at org.eclipse.jgit.gpg.bc.internal.keys.OCBPBEProtectionRemoverFactory$1.recoverKeyData(OCBPBEProtectionRemoverFactory.java:93) ... 18 more

And, for example, if a commit hook fails, no exception is thrown, but the symbols are also deactivated. After activate "Signed-off-by" again a second line of same text added. I need to deactivate it twice to delete both lines. And its really annoying and user unfriendly to activate the signing again.

msohn commented 2 months ago
Sduniii commented 2 months ago
  1. activate the buttons: egit1

  2. after commit, commit hook fails, because of intentionally wrong entered message format egit2

  3. buttons are deactivated: egit3 I activate the "Signed off" again to show you the second line. Then, i need to deactivate it twice to delete the Signed-off lines.

It's also in version 7.0.0. I deleted the line https://github.com/eclipse-egit/egit/blob/b01eccd78378ed9b3dcaf5833602d122daea4c1b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java#L4864 in my own build to test it, and it works like expected.