Open raphael-proust opened 8 years ago
I believe gitit does check the return status of the git commit command (which runs the pre-commit hook). I am surprised that the git commit would succeed if the pre-commit hook fails.
+++ Raphaël Proust [Sep 08 16 01:39 ]:
If a pre-commit hook is used, edits on the website may fail. When this is the case, the page simply doesn't update on “Save”, but it is not made clear to the person who tried to edit the page. Could gitit check the return code of the commit action (I'm not sure exactly how gitit performs the commit)
Ideally, the output of the pre-commit hook should be displayed (if any) along with a failure notice (if the exit code is not 0). Alternatively, a simple, generic error message would already be useful.
Should I look into adding this feature? Would that better be handled as a plugin? (Would a plugin have access to all the same info as a git hook?)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, [1]view it on GitHub, or [2]mute the thread.
References
The git commit does fail when the hook exits with non-zero. The issue is with the feedback to the person editing the wiki: there isn't any. The page is not updated, but the person editing the page doesn't receive a message telling them it failed.
OK, I see. It ought to give you a message. I don't have time to look into this now, though.
+++ Raphaël Proust [Sep 12 16 07:37 ]:
The git commit does fail when the hook exits with non-zero. The issue is with the feedback to the person editing the wiki: there isn't any. The page is not updated, but the person editing the page doesn't receive a message telling them it failed.
— You are receiving this because you commented. Reply to this email directly, [1]view it on GitHub, or [2]mute the thread.
References
I'll check if it's a version thing. Or if I need to pipe the message to stdin rather than stderr in the hook. Will report back in a bit.
If a pre-commit hook is used, edits on the website may fail. When this is the case, the page simply doesn't update on “Save”, but it is not made clear to the person who tried to edit the page. Could gitit check the return code of the commit action (I'm not sure exactly how gitit performs the commit)
Ideally, the output of the pre-commit hook should be displayed (if any) along with a failure notice (if the exit code is not 0). Alternatively, a simple, generic error message would already be useful.
Should I look into adding this feature? Would that better be handled as a plugin? (Would a plugin have access to all the same info as a git hook?)