All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tian Yuchen <a3205153416@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Scott Baker <scott@perturb.org>
Subject: Re: [PATCH 5/8] diff-highlight: use test_decode_color in tests
Date: Mon, 23 Mar 2026 13:48:49 +0800	[thread overview]
Message-ID: <b1064c6b-21df-4ea1-b753-549e0ca1f346@gmail.com> (raw)
In-Reply-To: <20260322204750.GB2047044@coredump.intra.peff.net>

On 3/23/26 04:47, Jeff King wrote:
> On Mon, Mar 23, 2026 at 01:24:00AM +0800, Tian Yuchen wrote:
> 
>>> @@ -42,9 +39,9 @@ dh_test () {
>>>    	} >/dev/null &&
>>>    	"$DIFF_HIGHLIGHT" <diff.raw >diff.hi &&
>>> -	test_strip_patch_header <diff.hi >diff.act
>>> +	test_strip_patch_header <diff.hi | test_decode_color >diff.act
>>
>> Although this is just simple text filtering and leaving it as is wouldn’t
>> cause any problems IMO, why not go ahead and add the && while you’re at it?
> 
> The bug is in an earlier commit (patch 3), which breaks apart the pipe
> but doesn't add the necessary &&. And it's more than just text
> filtering; it breaks the &&-chain, so we miss the exit code of
> $DIFF_HIGHLIGHT (which was the whole point of patch 3).
> 
> chainlint doesn't find it because we're in a helper function, not
> directinly in a test snippet.
> 
> I'll send a revised series to fix it, but...
> 
>> I've noticed that there are several missing &&.
> 
> Where else do you see?
> 
> Or do you mean that we should not pipe text filtering commands? There
> I'd disagree. We are not likely to see a failure from 'sed', and if we
> do, the fact that the output does not match would catch it. And the cost
> of breaking every command down without pipes means having to manage lots
> of intermediate files.
> 
> -Peff

Oh, I see.

To be honest, I didn't think about it in that much detail. I just 
noticed this tiny issue and wanted to take the opportunity to remind you 
to check other parts as well. I'm not saying we should remove those pipe 
commands :P

Thanks for the explanation about chainlint.

Regards, Yuchen

  reply	other threads:[~2026-03-23  5:48 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20  0:41 [PATCH 0/8] some diff-highlight tweaks Jeff King
2026-03-20  0:42 ` [PATCH 1/8] diff-highlight: mention build instructions Jeff King
2026-03-20  0:42 ` [PATCH 2/8] diff-highlight: drop perl version dependency back to 5.8 Jeff King
2026-03-20  0:43 ` [PATCH 3/8] diff-highlight: check diff-highlight exit status in tests Jeff King
2026-03-20  0:43 ` [PATCH 4/8] t: add matching negative attributes to test_decode_color Jeff King
2026-03-20  0:44 ` [PATCH 5/8] diff-highlight: use test_decode_color in tests Jeff King
2026-03-22 17:24   ` Tian Yuchen
2026-03-22 20:47     ` Jeff King
2026-03-23  5:48       ` Tian Yuchen [this message]
2026-03-23  5:53         ` Jeff King
2026-03-20  0:45 ` [PATCH 6/8] diff-highlight: test color config Jeff King
2026-03-20  0:47 ` [PATCH 7/8] diff-highlight: allow module callers to pass in " Jeff King
2026-03-20  0:48 ` [PATCH 8/8] diff-highlight: fetch all config with one process Jeff King
2026-03-22 17:18   ` Tian Yuchen
2026-03-22 20:45     ` Jeff King
2026-03-23  5:39       ` Tian Yuchen
2026-03-23  5:57         ` Jeff King
2026-03-23  6:01 ` [PATCH v2 0/8] some diff-highlight tweaks Jeff King
2026-03-23  6:01   ` [PATCH v2 1/8] diff-highlight: mention build instructions Jeff King
2026-03-23  6:02   ` [PATCH v2 2/8] diff-highlight: drop perl version dependency back to 5.8 Jeff King
2026-03-23  6:02   ` [PATCH v2 3/8] diff-highlight: check diff-highlight exit status in tests Jeff King
2026-03-23  6:02   ` [PATCH v2 4/8] t: add matching negative attributes to test_decode_color Jeff King
2026-03-23  6:02   ` [PATCH v2 5/8] diff-highlight: use test_decode_color in tests Jeff King
2026-03-23  6:02   ` [PATCH v2 6/8] diff-highlight: test color config Jeff King
2026-03-23  6:02   ` [PATCH v2 7/8] diff-highlight: allow module callers to pass in " Jeff King
2026-03-23  6:02   ` [PATCH v2 8/8] diff-highlight: fetch all config with one process Jeff King
2026-03-23 16:38   ` [PATCH v2 0/8] some diff-highlight tweaks Junio C Hamano
2026-03-24  6:50     ` Patrick Steinhardt

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=b1064c6b-21df-4ea1-b753-549e0ca1f346@gmail.com \
    --to=a3205153416@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=scott@perturb.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.