Re: [PATCH 10/22] mailmap tests: get rid of overly complex blame fuzzing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 12, 2021, 22:34 UTC
- Message-ID
- <xmqqlfcx239z.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20210112201806.13284-11-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 12 quoted lines
> + 6 6 1 > + Santa Claus > + 7 7 1 > + CTO > + EOF > + > + git blame --porcelain one >actual.blame && > + grep -E \ > + -e "[0-9]+ [0-9]+ [0-9]+$" \ > + -e "^author .*$" \ > + actual.blame >actual.grep && > + cut -d " " -f2-4 <actual.grep >actual.fuzz &&
An approach along the lines of ...
NUM="[0-9][0-9]*" sed -n -e "s/^author //p" \ -e "s/^$OID_REGEX \($NUM $NUM $NUM\)$/\1/p"
... would allow you to drop "cut" and also not assume that names do not have more than 3 tokens.