Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » pre-commit Hook "echo" message not appearing in popup
pre-commit Hook "echo" message not appearing in popup [message #1832929] Tue, 29 September 2020 11:21 Go to next message
Eclipse UserFriend
I have a pre-commit hook working in that it rejects commits to a particular branch but the "echo" message from the pre-commit hook does not appear in the popup window indicating the commit was canceled by the pre-commit hook.

The titlebar of the popup identifies that the pre-commit hook canceled the commit but other than a yellow triangle icon, the entire popup window is blank.

Here is the pre-commit hook:

#!/bin/sh

branch="$(git rev-parse --abbrev-ref HEAD)"

if [ "$branch" = "develop" ]; then
  echo "You can't commit directly to develop branch"
  exit 1
fi


And here is the popup (also attached in case it doesn't render in the message):

index.php/fa/38996/0/

Any suggestions?
Re: pre-commit Hook "echo" message not appearing in popup [message #1832939 is a reply to message #1832929] Tue, 29 September 2020 12:32 Go to previous message
Eclipse UserFriend
I stumbled across the fix for this... I needed to prefix my "echo" with ">&2" so it would be written to stderr (instead of stdout). DOH!

Please consider this issue closed
Previous Topic:Programmatically registration of a Project as a Git project
Next Topic:Git clone/pull with SSH from Azure DevOps repositories fails frequently
Goto Forum:
  


Current Time: Tue Jul 08 22:23:40 EDT 2025

Powered by FUDForum. Page generated in 0.06062 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top