]> git.ipfire.org Git - thirdparty/coreutils.git/commit
maint: commit-msg: compute UTF-8-aware line-length
authorJim Meyering <meyering@fb.com>
Mon, 20 Dec 2021 01:19:01 +0000 (17:19 -0800)
committerJim Meyering <meyering@fb.com>
Mon, 20 Dec 2021 18:46:11 +0000 (10:46 -0800)
commita2b21e910509f58a5d8c9976d46d7cd63d068ecc
treeb5d0fdcc79e4b46bedc605bc438907b3f138d18f
parent915a5e3360ecdda46af2b8cfdb2e63ef467b53c3
maint: commit-msg: compute UTF-8-aware line-length

* scripts/git-hooks/commit-msg: Count UTF-8 characters rather
than bytes to avoid erroneously rejecting as "longer than 72" a
log message line like the UTF-8 one for id.c just prior.  It has
77 bytes but only 67 characters.
(check_msg): Read in "utf8" mode. Also include actual length
in the diagnostic.
(main): Don't loop when stdout is redirected, as it is when
invoked via vc-dwim.
Paul Eggert reported privately both the error of counting bytes
rather than chars and the re_edit loop when failing via vc-dwim.
scripts/git-hooks/commit-msg