Community
Participate
Working Groups
While you can disable commit signing on an individual commit, it doesn't seem there is a way to disable this when using the `MergeCommand`. newHeadId = git.commit() .setReflogComment(refLogMessage.toString()) .setInsertChangeId(insertChangeId) .call() .getId(); I'm not sure if there is a precedent for this, or perhaps I am missing something, but it feels like there could be a way to customise the way the merge commits are made, perhaps with a lambda/strategy you can supply, e.g setCommitStrategy(Function<CommitCommand, CommitCommand> commitStrategy) { } setCommitStrategy(commit -> commit.setSign(false)) The workaround is to try and set this config at the entire repo level, but that's suboptimal in some circumstances.
Looks like some API is missing there. CommitCommand has setSign(), setSigningKey(), setGpgSigner(), setGpgConfig(). MergeCommand would need these, too, and forward the settings to the CommitCommand. A work-around for the MergeCommand in the current state might be to use setCommit(false) and then commit separately. Not nice, but maybe a valid work-around. Related, but those should be tracked in separate bugzilla issues: * RebaseCommand should also be examined. Should it re-sign rebased commits that were signed and committed by the current user, if there is a GpgSigner and key? * Same for CherryPickCommand.