Overview
Artifact ID: | 98862f6f44ede9f6c562615781a28d514b601c9b |
---|---|
Ticket: | 77de516a1f2bfc1bd996a8520d0ce59b1b324e77
Post-push patch |
User & Date: | wolfgang 2010-10-18 14:07:39 |
Changes
- Appended to comment:
<hr /><i>wolfgang added on 2010-10-18 14:07:39:</i><br /> Take a look at [9cf288de27], it's a complete implementation of a configurable post push hook. <blockquote>Agreed, this would be a bad thing. Could we simply append " &" to the hook command? That detaches the process from the command line, so it can complete in its own time. It works in *nix and I think it would work in Windows, though that point needs checking. One technique I know works in Windows is to prepend "start " to the command, but that doesn't work in *nix.</blockquote> OK, i see the point. We shouldn't add to much (OS-specific!) code to fossil. Using synchronous/asynchronous hooks should be part of the started scripts/programms. <blockquote>How about appending to a file named for the remote Fossil? That data could be included in the comment card, eg. #FAT12345678 saves output to 12345678.err.log.</blockquote> The hook can be triggered simultaneously from different sides. I think, i'll add a stdin/stderr redirect to a file with a timestamp/random number part. This fallback redirection is in addition to the redirect, defined in the program/script. <blockquote>Interesting. Does this not raise the spectre of potential abuse, though? Perhaps the remote user could be granted a special "allow custom hook" privilege.</blockquote> The server has its own setting which controls, which arguments are accepted. So i think, we don't need a new user permission. Checking user permissions would only check the permission of the sync user, not the permissions of the commit users. If needed, the called hook could check the timeline(rss?) to do a more qualified permission check. In addition to my first remarks, i added a server side command lineoption, to activate the hook command without the need of a push. Some ideas: * I'll add a new client and server side option, to trigger the the hook on all sync, not only, if files are pushed. The client will send a mark, if files where pushed on the push hook pattern message. * The name of the fallback log file will be added as first argument to the command line. The push hook pattern will be the second argument.