Re: [PATCH v3 2/2] am: support --empty-commit option to handle empty patches
- From
- Aleen 徐沛文 <pwxu@coremail.cn>
- Date
- Nov 15, 2021, 11:13 UTC
- Message-ID
- <60d0c28e.2943.17d234d975d.Coremail.pwxu@coremail.cn>
- In-Reply-To
- <ef33ce8c6f9e1e1519d3908edd3491fd00d78ac7.1636972769.git.gitgitgadget@gmail.com>
Dears Hamano,
Sorry about the late submission, and I have modified it to support the `--empty-commit=(die|skip|asis)` pattern.
Show 13 quoted lines
> +test_expect_success 'record as an empty commit when meeting e-mail message that lacks a patch' ' > + git am --empty-commit=asis empty-commit.patch && > + test_path_is_missing .git/rebase-apply && > + git show empty-commit --format="%B" >expected && > + git show HEAD --format="%B" >actual && > + grep -f actual expected && > + > + git am --empty-commit=asis cover-letter.patch && > + test_path_is_missing .git/rebase-apply && > + git show empty-commit --format="%B" >expected && > + git show HEAD --format="%B" >actual && > + grep -f actual expected > +'
When it comes to the last test case, there are some accidental contents recognized as commit messages inside an empty patch, like:
1. version signatures: > -- > 2.34.0.rc2.390.gef33ce8c6f 2. information of cover letter: > *** BLURB HERE *** > > A U Thor (1): > empty commit
I don't think it is necessary to fix it within `mailinfo.c`. Can you give me some suggestions on whether this case should be handled?
Aleen