Re: [PATCH v2 2/2] t: use commit_body to extract commit message bodies
- From
Shlok Kulshreshtha <diy2903@gmail.com>
- Date
- Jul 30, 2026, 18:02 UTC
- Message-ID
- <20260730180207.83197-1-diy2903@gmail.com>
- In-Reply-To
- <xmqqpl05o5n7.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 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.