Re: [PATCH] t4069: test diff behavior with i-t-a paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 10, 2020 at 6:09 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:
> > This can be improved by taking advantage of the OID_REGEX variable
> > defined by the test suite for matching an OID. So something like this
> > would be even better:
> >
> >     cat >expect <<-\EOF &&
> >     diff --git a/test-file b/test-file
> >     index OID..OID 100644
> >     --- a/test-file
> >     +++ b/test-file
> >     EOF
> >     cat blueprint >test-file &&
> >     git diff --ita-visible-in-index -- test-file >raw &&
> >     sed "s/$OID_REGEX/OID/g" raw >actual &&
> >     test_cmp expect actual
>
> OID_REGEX is [0-9a-f]{40} while what is used here is [0-9a-f]{1,}.
> Unless --full-index is in use, they mean different things, no?

You're right, of course. The regex in the original example I gave was
too loose, matching even single hex letters in words like "index" and
"test-file", so I wanted to tighten it up, but I botched it with
OID_REGEX. Anyhow, I hope my examples convey the general idea (which
needs a bit of tweaking from what I showed).



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux