the gentoo news pre-receive hook is not clear at all as to why it's rejecting things. for example, i was missing ".en" in the filename, but the hook just said "path syntax invalid". this script needs to be super explicit whenever it rejects a commit. also, where is the hook code hosted ? the error message should also include a reference to that for people. $ git push PR --signed Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 980 bytes | 0 bytes/s, done. Total 4 (delta 1), reused 0 (delta 0) remote: ./hooks/pre-receive.gentoo-news: errors in commits remote: Path syntax invalid: 2015-10-22-gcc-5-new-cxx11-abi/2015-10-22-gcc-5-new-cxx11-abi.txt remote: To git+ssh://git@git.gentoo.org/data/gentoo-news.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'git+ssh://git@git.gentoo.org/data/gentoo-news.git'
Created attachment 415434 [details] Current hook I doubt it's hosted anywhere. Attaching the current version copied from git.g.o.
Created attachment 415566 [details] updated hook cleaned up a bunch of various issues that pylint caught and clarified the errors
Looks good to me but I'd rather have robbat2 and/or ulm confirm it. Though personally I thought you'd kill the regexp and instead do hard-parsing with even more detailed error messages.
The clarified error message LGTM. About the changes related to python syntax, I fear my python skills are not adequate for commenting on them.