New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display error message when commit fails (due to pre-commit hook) #567

Open
raphael-proust opened this Issue Sep 8, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@raphael-proust

raphael-proust commented Sep 8, 2016

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?)

@jgm

This comment has been minimized.

Show comment
Hide comment
@jgm

jgm Sep 12, 2016

Owner

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

  1. #567
  2. https://github.com/notifications/unsubscribe-auth/AAAL5AZAdYJW0h4CFRwOdVSKAnkorph1ks5qn8nHgaJpZM4J3vsq
Owner

jgm commented Sep 12, 2016

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

  1. #567
  2. https://github.com/notifications/unsubscribe-auth/AAAL5AZAdYJW0h4CFRwOdVSKAnkorph1ks5qn8nHgaJpZM4J3vsq
@raphael-proust

This comment has been minimized.

Show comment
Hide comment
@raphael-proust

raphael-proust Sep 12, 2016

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.

raphael-proust commented Sep 12, 2016

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.

@jgm

This comment has been minimized.

Show comment
Hide comment
@jgm

jgm Sep 12, 2016

Owner

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

  1. #567 (comment)
  2. https://github.com/notifications/unsubscribe-auth/AAAL5GfR8CyJt3InnONbH0dbKr3KYU1tks5qpWOpgaJpZM4J3vsq
Owner

jgm commented Sep 12, 2016

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

  1. #567 (comment)
  2. https://github.com/notifications/unsubscribe-auth/AAAL5GfR8CyJt3InnONbH0dbKr3KYU1tks5qpWOpgaJpZM4J3vsq
@raphael-proust

This comment has been minimized.

Show comment
Hide comment
@raphael-proust

raphael-proust Sep 13, 2016

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.

raphael-proust commented Sep 13, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment