Re: [PATCH v2 2/2] t: use commit_body to extract commit message bodies

Shlok Kulshreshtha <[email protected]> Thu, 30 Jul 2026 23:32:07 +0530
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
Junio C Hamano <[email protected]> writes:

> I would not claim to have checked all of these changes, but I did
> spot check a handful and they all looked reasonable.
>
> Shall we mark the topic for 'next'?

Yes, please.

To save you reading all 66 hunks: 63 of them are the same local swap,
where the rev and the output file are unchanged and only the spelling
differs.

	-git cat-file commit HEAD | sed -e "1,/^\$/d" >actual
	+commit_body HEAD >actual

Each one can be confirmed by looking at the hunk alone.

The three hunks that are worth actual attention are:

* t7509-commit-authorship.sh, the hunk at author_header().  This one
  deletes the file's local message_body() helper rather than
  substituting anything; its call sites become commit_body elsewhere in
  the file.

* t7600-merge.sh, "merge --no-ff --edit".  The test grepped the raw
  commit object for a phrase and then stripped the header for the
  comparison.  The phrase is in the body rather than the header, so the
  grep now runs against the already-stripped body and both steps share
  one commit_body call.

* t3900-i18n-commit.sh, in test_commit_autosquash_multi_encoding().
  The stripped body was piped into "iconv".  Piping commit_body into
  "iconv" would reintroduce the exit-code hole,
  so the body is written to a file and "iconv"
  reads the file.

Everything else in the patch is the swap above.