Re: [PATCH 1/1] t3206-range-diff.sh: cover single-patch case
- Date: Tue, 11 Sep 2018 17:34:29 -0400
- From: Eric Sunshine <sunshine@xxxxxxxxxxxxxx>
- Subject: Re: [PATCH 1/1] t3206-range-diff.sh: cover single-patch case
On Tue, Sep 11, 2018 at 4:26 PM Derrick Stolee via GitGitGadget
> The commit 40ce4160 "format-patch: allow --range-diff to apply to
> a lone-patch" added the ability to see a range-diff as commentary
> after the commit message of a single patch series (i.e. [PATCH]
> instead of [PATCH X/N]). However, this functionality was not
> covered by a test case.
> Add a simple test case that checks that a range-diff is written as
> commentary to the patch.
> Signed-off-by: Derrick Stolee <dstolee@xxxxxxxxxxxxx>
> diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
> @@ -154,4 +154,9 @@ do
> +test_expect_success 'format-patch --range-diff as commentary' '
> + git format-patch --stdout --range-diff=HEAD~1 HEAD~1 >actual &&
> + grep -A 1 -e "\-\-\-" actual | grep "Range-diff:"
Aside from Junio's and Stefan's comments...
Patch 6/14 , in addition to checking that a solo patch contains an
interdiff, takes the extra step of checking that individual patches
_don't_ contain an interdiff when --cover-letter is used. I wonder if
the same should be done here, though I don't feel too strongly about
it. If you do go that route, it might make sense to move this test to
t4014 as neighbor to the --interdiff tests. The reason 10/14  added
the "git format-patch --range-diff" test to t3206 instead of t4014 was
so it could do a thorough check of the embedded range-diff by re-using
the specially crafted test repo set up by t3206. Your new test is much
looser, thus could be moved alongside the --interdiff tests. Not a big
deal, though. Either way is fine. Thanks for working on this.