summaryrefslogtreecommitdiff
path: root/scripts/git-hooks/commit-msg
Commit message (Collapse)AuthorAgeFilesLines
* scripts: commit-msg: recognize Git cut_linesArsen Arsenović2022-11-201-0/+1
| | | | | This prevents spurious failures from happening when someone sets commit.verbose or passes -v to commit.
* scripts: fix typo in commit-msg git-hook scriptDaniel Knittl-Frank2022-01-121-1/+1
| | | | | | | Commit 2f438fa9f53250fb3c8b39a95eedd627b5569ca4 (basenc: A new program complementary to base64/base32) introduced a typo in the list of allowed commit message prefixes, accidentally changing "basename" to "nbasename". Revert it back to the correct "basename".
* maint: commit-msg: compute UTF-8-aware line-lengthJim Meyering2021-12-201-3/+6
| | | | | | | | | | | | | * 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.
* maint: rename md5sum.c to more general digest.cPádraig Brady2021-09-151-1/+1
| | | | | | | | | | | md5sum.c will be the base for all digest functions, so rename accordingly. * src/md5sum.c: Rename to ... * src/digest.c: ... renamed from md5sum.c * scripts/git-hooks/commit-msg: Allow digest: commit prefix. * po.POTFILES.in: Adjust to new name. * src/local.mk: Likewise.
* maint: allow hook script accept "Signed-off-by:"Pádraig Brady2021-08-141-3/+0
| | | | * scripts/git-hooks/commit-msg: Relax this constraint.
* basenc: A new program complementary to base64/base32Assaf Gordon2018-12-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Encodes/decodes data in various common formats: base64,base64url,base32,base32,base16,base2,z85. Discussed here: https://lists.gnu.org/r/coreutils/2018-11/msg00014.html https://lists.gnu.org/r/coreutils/2018-12/msg00019.html * AUTHORS: Add basenc. * README: Reference the new program. * NEWS: Mention the new program. * build-aux/gen-lists-of-programs.sh: Add basenc. * doc/coreutils.texi: (basenc invocation): Document the new command. * man/.gitignore: Ignore the generated man page. * man/basenc.x: A new template, with few examples. * man/local.mk: Reference the new man page. * scripts/git-hooks/commit-msg: Allow basenc as program prefix. * src/.gitignore: Ignore the new binary. * src/basenc.c: (usage): Mention new options. (main): Handle new options. (isbase*, base*_length, base*_encode, base*_decode_ctx): Implement new encoding/decoding formats. * src/local.mk: Add new program. * tests/local.mk: Add new test. * tests/misc/basenc.pl: New tests. * tests/misc/help-version.sh (basenc_setup): use '--version' for default invocation (basenc errors with no parameters).
* maint: make hook script reject "/archive/html" in lists.gnu.org URLSJim Meyering2017-11-071-0/+3
| | | | | * scripts/git-hooks/commit-msg: Require the abbreviated "/r/" form in any log message URL.
* all: prefer HTTPS in URLsPaul Eggert2017-09-191-2/+2
|
* b2sum: a new checksum utility with md5sum like interfacePádraig Brady2016-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note we don't support the --algorithm option of the b2sum command in the external BLAKE2 project, as that was deemed too confusing for users. "BLAKE2b" was chosen as the default algorithm to use, which is single threaded but performs well on 64 bit. * src/blake2: CC0 source copied from external project. * cfg.mk[VC_LIST_ALWAYS_EXCLUDE_REGEX]: Exclude blake2/ from syntax checks, make update-copyright, etc. * src/local.mk: Reference the sources for b2sum, and set the compilation flags. * doc/coreutils.texi (b2sum invocation): Reference the md5sum invocation node, and add descriptions of -l. * tests/misc/b2sum.sh: Add new test. * tests/local.mk: Reference new test. * AUTHORS: Add new binary. * README: Likewise. * build-aux/gen-lists-of-programs.sh: Likewise. * man/.gitignore: Likewise. * scripts/git-hooks/commit-msg: Likewise. * man/b2sum.x: New man page template. * man/local.mk: Reference new template. * src/.gitignore: Ignore new binaries. * src/blake2/.gitignore: Ignore new build atrifacts. * src/md5sum.c (usage): Describe the new -l option. * NEWS: Mention the new program.
* maint: allow 'sha*sum:' tag in commit summariesPádraig Brady2015-11-231-1/+1
| | | | | To support "md5sum,sha*sum:" Suggested by Bernhard Voelker.
* maint: allow 'all:' tag in commit summariesPádraig Brady2015-10-291-1/+1
| | | | | To tag changes that are user visible and affect all (or many) commands.
* base32: A new program similar to base64Pádraig Brady2015-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Suggested in https://bugzilla.redhat.com/1250113 * AUTHORS: Add base32. * THANKS.in: Add suggester. * README: Reference the new program. * NEWS: Mention the new program. * src/.gitignore: Ignore the new binary. * bootstrap.conf: Reference the gnulib base32 module. * build-aux/gen-lists-of-programs.sh: Add base32. * man/base32.x: A new template. * man/.gitignore: Ignore the new man page. * man/local.mk: Reference the new man page. * doc/coreutils.texi (base32 invocation): Document the new command. * src/local.mk: Adjust to build base32 based on base64.c. * src/base64.c: Parameterize to use the correct headers, functions and buffer sizes, depending on which binary is being built. * tests/misc/base64.pl: Adjust to test both base32 and base64. * tests/misc/tty-eof.pl: Add base32 as a program that accepts input on stdin without any options specified. * scripts/git-hooks/commit-msg: Add base32 to the template.
* maint: choose editor in the commit-msg git hook the same way git doesStefano Lattarini2013-02-181-1/+4
| | | | | | | | | | | | | | | | | | Git honours the GIT_EDITOR environment variable, the "core.editor" Git configuration variable, and the EDITOR environment variable (in that order, and defaulting to "vi" if none of them is set) to decide which editor should be invoked for the user when he has to or want to edit his commit message. However, our commit-msg hook, when invoking an editor on behalf of the user to allow him to fix a non-policy-complaint commit message, only honoured the EDITOR environment variable. To avoid potential annoying inconsistencies, we should really use the same logic used by Git in the selection of the editor. Luckily, we don't have to duplicate this logic (that would be brittle in the long term), as we can rely on the "git var" command, designed exactly to be used in situations like this. * scripts/git-hooks ($editor): Adjust definition.
* maint: don't reset PATH in the commit-msg git hookStefano Lattarini2013-02-181-1/+0
| | | | | | | | | | | | | | | | I have a custom 'editor' script in ~/bin, and a system-provided 'editor' program in /usr/bin (on Debian, this is a link set up the "debian alternatives" subsystem). My '$EDITOR' and '$GIT_EDITOR' variables are set simply to 'editor' (no absolute path), which I expect should point to my 'editor' script, since ~/bin precedes /usr/bin in my PATH definition. But the 'commit-msg' hook used in coreutils unconditionally resets its PATH to '/bin:/usr/bin', which causes it to call the "wrong" editor (the one in /usr/bin, not the one in ~/bin) when it makes me update a botched commit message. * scripts/git-hooks: Don't reset $ENV{PATH} to '/bin:/usr/bin', which was only done to avoid failure when enabling Perl's taint checking.
* maint: prevent trailing period at first line of a commit messageBernhard Voelker2013-02-141-0/+3
| | | | | * scripts/git-hooks/commit-msg (bad_first_line): Return an error message if the first line of a commit message ends with a period.
* numfmt: a new command to format numbersAssaf Gordon2013-02-041-1/+1
| | | | | | | | | | | | | | | | | * AUTHORS: Add my name. * NEWS: Mention the new program. * README: Reference the new program. * src/numfmt.c: New file. * src/.gitignore: Ignore the new binary. * build-aux/gen-lists-of-programs.sh: Update. * scripts/git-hooks/commit-msg: Allow numfmt: commit prefix. * po/POTFILES.in: Add new c file. * tests/misc/numfmt.pl: A new test file giving >93% coverage. * tests/local.mk: Reference the new test. * man/.gitignore: Ignore the new man page. * man/local.mk: Reference the new man page. * man/numfmt.x: A new template. * doc/coreutils.texi: Document the new command.
* scripts: fix the Signed-off-by:-prohibiting hook to actually workJim Meyering2012-08-311-1/+1
| | | | | * scripts/git-hooks/commit-msg: Fix new test: we're searching a multi-line buffer, so add the //m modifier.
* scripts: git commit message hook: prohibit use of "Signed-off-by:"Jim Meyering2012-08-301-0/+3
| | | | | * scripts/git-hooks/commit-msg: Reject a commit log message that contains "Signed-off-by:".
* su: remove program (util-linux is now the best source for it)Jim Meyering2012-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | * README: Omit "su" from list of programs. * src/su.c: Remove file. * src/Makefile.am: Remove su-related rules and variables. * tests/misc/su-fail: Remove test. * tests/Makefile.am (TESTS): Remove misc/su-fail. * tests/misc/invalid-opt: Remove su-related code. * src/.gitignore: Remove su. * man/su.x: Remove file. * man/Makefile.am (su.1): Remove rule. * po/POTFILES.in: Remove su.c from the list. * TODO: Remove ancient entry. * NEWS (Changes in behavior): Mention it. * doc/coreutils.texi: Remove su-related description. * AUTHORS: Remove su. * m4/lib-check.m4 (cu_LIB_CHECK): Remove file/macro. * configure.ac: Remove su-related code and sole use of cu_LIB_CHECK. * scripts/git-hooks/commit-msg: Remove su from this list, too.
* scripts: encourage use of shorter "bugs.gnu.org" in bug URLsJim Meyering2012-05-101-1/+1
| | | | * scripts/git-hooks/commit-msg: Also ding debbugs.gnu.org URLs.
* scripts: allow one-line summary to start with "[Vv]ersion \d"Jim Meyering2012-01-061-11/+24
| | | | | | | * scripts/git-hooks/commit-msg: Do not reject the commit log message generated by our automated release-and-tag process. (bad_first_line): New function, extracted from... (check_msg): ... here. Use it.
* realpath: a new program to print the resolved pathPádraig Brady2012-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This program is compatible with other realpath(1) implementations, and also incorporates relpath like support, through the --relative options. The relpath support was suggested by Peng Yu, who also provided an initial implemenation of that functionality. * AUTHORS: Add my name. * NEWS: Mention the new command. * README: Likewise. * doc/coreutils.texi (realpath invocation): Add realpath info. * man/Makefile.am (realpath.1): Add dependency. * man/realpath.x: New template. * man/.gitignore: Ignore generated man page. * po/POTFILES.in: Add src/realpath.c. * src/.gitignore: Exclude realpath. * src/Makefile.am (EXTRA_PROGRAMS): Add realpath. * src/realpath.c: New file. * scripts/git-hooks/commit-msg: Add realpath to the list of prefixes. * tests/Makefile.am (TESTS): Add misc/realpath. * tests/misc/realpath: New file.
* scripts: commit-msg: tweak 72-column test to avoid a false-positiveJim Meyering2011-11-231-1/+1
| | | | | | * scripts/git-hooks/commit-msg: Don't warn about a line that is longer than 72 if it is a comment. Git-generated comments would occasionally trigger this.
* scripts: rewrite git commit-msg hook in PerlJim Meyering2011-11-181-69/+129
| | | | | | | * scripts/git-hooks/commit-msg: Rewrite in perl. This is still a work in progress in that it hard-codes coreutils- specific program names and policies that should be easy to selectively enable or disable without modifying the script.
* maint: adjust git hook to allow "copy: ..." on line 1 of commit messageJim Meyering2011-11-131-1/+1
| | | | | * scripts/git-hooks/commit-msg: Add "copy" to the list of valid command-name-like summary line prefixes.
* scripts: reject references to long-form bug URLsJim Meyering2011-11-021-0/+6
| | | | | * scripts/git-hooks/commit-msg: Require the normalized/shortened form of bugzilla.redhat.com and bugs.gnu.org bug URLs.
* maint: add git hook scriptsJim Meyering2011-10-231-0/+74
We find it worthwhile to use consistent commit summary prefixes. To that end, the commit-msg script requires that all commits I make start with "$P: " (where $P is one of ~100 programs in coreutils) or one of a few other words, like gnulib tests maint doc build. It allows more than one word, so e.g., "cat tail head: " would also be accepted. Pádraig Brady wrote the initial version, with its 72-column and blank-if-present second line checks. The pre-commit script is the same as the git-supplied sample script, modulo a bug fix and the "exec 1>&2" redirection. * scripts/git-hooks/commit-msg: New file. * scripts/git-hooks/pre-commit: New file. * scripts/git-hooks/applypatch-msg: New file. Verbatim from .sample. * cfg.mk: Exempt two of the new scripts from the no-leading-TABs check, since they're nearly verbatim from git, and we want to stay in sync. Exempt the commit-msg script from the no-"fail=0" check.