Skip to content

Commit b868bee

Browse files
committed
commit-email.rb: Suppres git signed commit signatures
When setting `log.showSignature=true`, `git log` and `git show` include messages gpg verfied the commits, in addition to the message specified by `--pretty`.
1 parent 07b59ee commit b868bee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tool/commit-email.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def build_diff(path, numstats)
121121
end
122122

123123
def git_show(revision, format:)
124-
git('show', "--pretty=#{format}", '--no-patch', revision).strip
124+
git('show', '--no-show-signature', "--pretty=#{format}", '--no-patch', revision).strip
125125
end
126126

127127
def git(*args)
@@ -180,7 +180,7 @@ def main(repo_path, to, rest)
180180
args, options = parse(rest)
181181

182182
infos = args.each_slice(3).flat_map do |oldrev, newrev, refname|
183-
revisions = IO.popen(['git', 'log', '--reverse', '--pretty=%H', "#{oldrev}^..#{newrev}"], &:read).lines.map(&:strip)
183+
revisions = IO.popen(['git', 'log', '--no-show-signature', '--reverse', '--pretty=%H', "#{oldrev}^..#{newrev}"], &:read).lines.map(&:strip)
184184
revisions[0..-2].zip(revisions[1..-1]).map do |old, new|
185185
GitInfoBuilder.new(repo_path).build(old, new, refname)
186186
end

0 commit comments

Comments
 (0)