Created attachment 376674 [details] pre-commit hook Hello, Due to some human errors(mistyping, typos, etc) that happen in repositories.xml and because the file is getting bigger and bigger, I wrote this pre-commit hook that checks repositories.xml based on repositories.dtd[1]. I'd like your feedback and your suggestions for improvements. [1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/xml/htdocs/dtd/repositories.dtd?revision=1.1&content-type=text%2Fplain Thanks, Pavlos
*** Bug 513252 has been marked as a duplicate of this bug. ***
I wonder: Wouldn't we need a pre-receive hook or so rather than a (client side) pre-commit hook?
For the record: for some time already I have enabled XML Schema checks via semaphore CI [1] on the github mirror of the repository [2]. Since the mirror is automatically updated, this covers both pull requests filed against the repository and the commits made to git.g.o. [1]:https://semaphoreci.com/mgorny/api-gentoo-org/branches/master/ [2]:https://github.com/gentoo/api-gentoo-org/
FWIW, the pre-commit hook could (and probably should) use the `check` Makefile target that is provided in the repository. In my experience pre-commit hooks have the potential to confuse new contributors. That said, I am more then willing to active a pre-commit hook and see how it works out (as I am usually in favor of pre-commit hooks under the right circumstances). (In reply to Michał Górny from comment #3) > [...] Since the > mirror is automatically updated, this covers both pull requests filed > against the repository and the commits made to git.g.o. Right, but is the causing entity, i.e., the author and committer of the offending commit(s), notified that the github CI failed? Ideally we would have a pre-receive hook that directly notifies the causing entity. Could we maybe get a pre-receive hook for api.git that runs "make check"?