所以我最近克隆了 gnu-coreutils 來看看我使用的程式是如何實際作業的,并更熟悉 git,尤其是 git 的 CLI。但是當我嘗試提交我對 basename.c 使用git commit src/basename.c描述所做的更改時basename: some-desc,它回傳了錯誤
commit-msg: invalid first word(s) of summary line: basename
Interrupt (Ctrl-C) to abort...
Too many errors from stdin
commit-msg: .git/COMMIT_EDITMSG: the editor (editor) failed, aborting
此描述遵循存盤庫中包含的“HACKING”檔案中的準則:
Try to make the summary line fit one of the following forms:
program_name: change-description
prog1, prog2: change-description
doc: change-description
tests: change-description
build: change-description
maint: change-description
但仍然不接受 gitbasename作為程式名稱。其他程式的名稱,例如cat,base64和chcon作業,所以也許這只是一個錯誤?
我也嘗試在谷歌上搜索這個問題,但除了關于如何格式化 git commit 訊息的一般指南之外,我找不到任何東西。
uj5u.com熱心網友回復:
coreutils 存盤庫在存盤庫的本地克隆中設定Git掛鉤。您可以在 中找到提交訊息檢查scripts/git-hooks/commit-msg。
每次嘗試提交時都會運行它。它定義了從第 14 行開始的允許的關鍵字:
# Keywords allowed before the colon on the first line of a commit message:
# program names and a few general category names.
my @valid = qw(
arch b2sum base32 base64 basenc nbasename cat chcon chgrp chmod chown
chroot cksum comm cp csplit cut date dd df dir dircolors dirname du echo
env expand expr factor false fmt fold groups head hostid hostname id
install join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp
mv nice nl nohup nproc numfmt od paste pathchk pinky pr printenv printf
ptx pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum
sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty
sum sync tac tail tee test timeout touch tr true truncate tsort
tty uname unexpand uniq unlink uptime users vdir wc who whoami yes
all copy gnulib tests maint doc build scripts sha\*sum digest
);
basename不在其中,但nbasename在。
要暫時禁用正在運行的提交掛鉤,請--no-verify在提交期間指定。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/403597.html
標籤:
