]> source.dussan.org Git - jgit.git/commit
TagCommand: support signing annotated tags 39/173439/3
authorThomas Wolf <thomas.wolf@paranor.ch>
Sat, 5 Dec 2020 21:01:25 +0000 (22:01 +0100)
committerThomas Wolf <thomas.wolf@paranor.ch>
Mon, 7 Dec 2020 08:33:57 +0000 (09:33 +0100)
commit41b9159795d6f64bba6a67ce2f22fe1b7679ea55
tree1fbbf43003479ea855a6f7a09f7c8abb02524e50
parent5abd8a4feb5da689982c12b65faef34aabedeb26
TagCommand: support signing annotated tags

Add the two config constants from C git that can switch on signing
of annotated tags. Add them to the GpgConfig, and implement actually
signing a tag in TagCommand.

The interactions between command line options for "git tag" and config
options is a bit murky in C git. There are two config settings for it:

* tag.gpgSign is the main option, if set to true, it kicks in if
  neither -s nor -u are given on the command line.
* tag.forceSignAnnotated signs only tags created via "git tag -m",
  but only if command-line option "-a" is not present. It applies
  even if tag.gpgSign is set explicitly to false.

Giving -s or -u on the command line also forces an annotated tag
since lightweight tags cannot be signed.

Bug: 386908
Change-Id: Ic8a1a44b5f12f47d5cdf3aae2456c1f6ca9ef057
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/TagCommandTest.java
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/GpgConfig.java