wiki pre-commit hook
|Reported by:||Owned by:||Christian Boos|
Would be nice to have a feature of wiki pre-commit hook. In my
trac.ini file I would say something like this:
Every time anyone makes changes to any wiki page, this shell script is called with params:
pre-commit.sh "pagename" "comment" < "new content"
If the script returns empty string, everything is fine, and the changes are saved to wiki. If the result is not empty, it is interpreted like comments/errors/warnings to certain lines of the wiki page (or to the entire page). Every line will contain one comment, with a prefix (which could be omitted):
crit,7-9:itemized lists are disallowed in specification pages... err,14,32:syntax error, NAME expected... warn,19:it is recommended to use existing CamelCase entities... empty comment line, please use format required by DevelopmentGuidelines
Prefix has three fields (any one of them can be omitted):
- type of error (
- lines interval (
7-9) or line number (
19), entire document by default
- position in line (
32), no position by default
Empty prefix means that this is an error related to entire page.
If and when pre-commit hook returns errors/warnings Trac disables changes and shows errors on their correspondent lines. Or on top of the page, if errors/warnings are related to the entire page.
Change History (14)
comment:1 by , 12 years ago
|Component:||general → wiki system|
|Status:||new → closed|