From: PMEase Date: Mon, 28 Mar 2022 06:11:35 GMT Subject: Re: How to get the original raw commit message without removing extra leading/trailing line breaks Message-ID: <0D9BB163-A369-47DE-A0DC-AD396FD6DBE4@pmease.com> In-Reply-To: It also converts \r\n to \n and remove all spaces in a blank line. This is reasonable for a readable commit message, but makes it impossible to verify signature in my program... > On Mar 28, 2022, at 1:53 PM, Junio C Hamano wrote: > > PMEase writes: > > [jc: wrapped overly long lines] > >> I am using command "git show --format=raw " 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 " will not give "raw > commit object" to begin with. It indents the message by four > spaces. > > "git cat-file commit " is what you want, I > think.