Re: How to get the original raw commit message without removing extra leading/trailing line breaks
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 28, 2022, 05:53 UTC
- Message-ID
- <xmqq5yny62s1.fsf@gitster.g>
- In-Reply-To
- <1BEBB3E1-0089-44CD-8D3B-3AA424C90E48@pmease.com>
PMEase <robin@pmease.com> writes:
[jc: wrapped overly long lines]
Show 6 quoted lines
> I am using command "git show --format=raw <commit hash>" to get > raw commit object in order to verify the GPG signature in my > program to customize public key loading. However in the raw commit > object, extra line breaks before and after the commit message is > removed, which cause the signature verification failure as git > generates the signature without removing those line breaks.
"git show --format=raw <commit object name>" will not give "raw commit object" to begin with. It indents the message by four spaces.
"git cat-file commit <commit object name>" is what you want, I think.