[Bug 268024] .hooks/pre-commit.d/check_portepoch broken on lines affecting PORTEPOCH comments

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 18 Dec 2022 08:59:49 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268024

--- Comment #6 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/ports/commit/?id=414b5c61645669a346fc817e0b5852c265b96187

commit 414b5c61645669a346fc817e0b5852c265b96187
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2022-11-27 12:51:51 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2022-12-18 08:58:17 +0000

    .hooks/pre-commit.d: unbreak EPOCH checker

    dns/dnsmasq-devel as of 2.88rc3 contained a comment about PORTEPOCH,
    which I removed in the 2.88rc5. This tripped up the checker because
    it assumed that if git yielded lines containing PORTEPOCH, then it
    must have been PORTEPOCH= or similar lines. Untrue in my case.

    It was printing
    [pre-commit] dropped PORTEPOCH  in dns/dnsmasq-devel/Makefile

    To solve, only pick out PORTEPOCH diffs that are actual assignments,
    and if the new PORTEPOCH is empty, and the old one is also,
    ignore this condition (previously we would exit 1, which is bogus).

    Also, grep without -E should not have \ in front of - or +.
    FreeBSD 13.1 grep is fine, but GNU grep ignores those backslashes
    noisily (and I have prepended it to PATH) and emits warnings.

    PR:             268024

 .hooks/pre-commit.d/check_portepoch | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.