]> git.ipfire.org Git - thirdparty/openvpn.git/commit
pre-commit: uncrustify based on staged changes
authorHeiko Hund <heiko@ist.eigentlich.net>
Tue, 17 May 2022 21:01:21 +0000 (23:01 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 22 May 2022 15:18:20 +0000 (17:18 +0200)
commitd78c2a73a8f631f082ec03bb21b329d3e6fd00dd
treed952ef68c49348a5b27536266cb807d6d33af6f6
parenta76153c1ca98c841b8c8cf3b6ade6c00ee3876a5
pre-commit: uncrustify based on staged changes

Previously the generated patch was based on the file(s) in the working
directory. This is a problem if you have not to be commited changes
there and these changes fix formatting issues that exist in the staging
area. This effectively circumventes the script from rejecting the
commit.

An example:
   git add file.c
   git commit
   ... pre-commit hooks complains about formatting ...
   ... you fix the file manually, forget to git add ...
   git commit
   ... succeeds, even though the commit still has issues ...

Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Antonio Quartulli <a@unstable.cc>
Message-Id: <20220517210121.1312072-1-heiko@ist.eigentlich.net>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24376.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
dev-tools/git-pre-commit-uncrustify.sh