Re: [PATCH v2 02/10] t4207: test coloring of grafted decorations
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 4, 2022, 04:05 UTC
- Message-ID
- <CAPig+cSjHf3d6xKT71biR8Cd0iKHqBpQ6Q9_bd_w9Hgg_uE=0g@mail.gmail.com>
- In-Reply-To
- <220803.86les5fpfg.gmgdl@evledraar.gmail.com>
On Wed, Aug 3, 2022 at 9:05 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 21 quoted lines
> On Wed, Aug 03 2022, Eric Sunshine wrote:
> > On Wed, Aug 3, 2022 at 2:32 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> >> On Fri, Jul 29 2022, Derrick Stolee via GitGitGadget wrote:
> >> > + sed "s/[0-9a-f]\{10,10\}/COMMIT_ID/" |
> >>
> >> {10,10} in a regex is just {10}, no?
> >
> > I'm more than a little surprised that this regex repeat-count notation
> > works on macOS `sed` which, in the BSD tradition, is rather feature
> > poor. Testing it, though, I find that it does work, even on my
> > relatively old version of macOS. However, I'd still worry about other
> > BSD `sed`s in the wild.
>
> It seems you missed it but we already have this code tested "in the
> wild", i.e. the "new" code here is really just copy/pasting test setup
> from above.
>
> So maybe we want to change (and you have some good suggestions here),
> but it's already shown itself to be portable enough. We've had this
> "sed" command since v1.7.2, or 567102819ac (Add test for correct
> coloring of git log --decoration, 2010-06-29).No, I didn't miss it; I saw your mention that it was copied from existing code in the script, but I assumed the existing code was recent -- hence my surprise. Since it's been around so long, I agree, it's hardly a cause for concern at this point (though, I still reflexively write the more portable notation as used by `OID_REGEX` and `_x05`, etc.).