Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: PMEase <robin@pmease.com>
Cc: git@vger.kernel.org
Subject: Re: How to get the original raw commit message without removing extra leading/trailing line breaks
Date: Sun, 27 Mar 2022 22:53:50 -0700	[thread overview]
Message-ID: <xmqq5yny62s1.fsf@gitster.g> (raw)
In-Reply-To: <1BEBB3E1-0089-44CD-8D3B-3AA424C90E48@pmease.com> (PMEase's message of "Mon, 28 Mar 2022 13:42:18 +0800")

PMEase <robin@pmease.com> writes:

[jc: wrapped overly long 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.

  reply	other threads:[~2022-03-28  5:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  5:42 How to get the original raw commit message without removing extra leading/trailing line breaks PMEase
2022-03-28  5:53 ` Junio C Hamano [this message]
2022-03-28  6:01   ` PMEase
2022-03-28  6:11     ` Junio C Hamano
2022-03-28  6:11   ` PMEase

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq5yny62s1.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=robin@pmease.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox