]> git.ipfire.org Git - thirdparty/openssl.git/commit
fix: util/check-format-commit.sh to handle one-line diff hunks
authorRichard Levitte <levitte@openssl.org>
Tue, 16 Jul 2024 03:28:30 +0000 (05:28 +0200)
committerDr. David von Oheimb <dev@ddvo.net>
Sat, 26 Oct 2024 17:16:31 +0000 (19:16 +0200)
commita580f6771497e290b22aea74563a3d4762d46319
treeac006e5b03c612a792bae68094447ec3a04780a1
parentd3c992937280b96bfe516605dc1c7a0eabe15060
fix: util/check-format-commit.sh to handle one-line diff hunks

For multi-line hunks, 'git diff -U0' outputs a pair of START,COUNT
indicators to show where the hunk starts and ends.  However, if the hunk is
just one line, only START is output, with the COUNT of 1 being implied.
Typically, this happens for copyright change hunks, like this:

    --- a/crypto/evp/evp_err.c
    +++ b/crypto/evp/evp_err.c
    @@ -3 +3 @@
    - * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
    + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.

This is normal unified diff output, and our script must adapt.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24900)

(cherry picked from commit 7821b7b9774d481ae92610e2d132ea34d4aaf407)
util/check-format-commit.sh