Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:21 Go to next message
Dave Searles is currently offline Dave SearlesFriend
Messages: 2
Registered: September 2020
Junior Member
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 16:32 Go to previous message
Dave Searles is currently offline Dave SearlesFriend
Messages: 2
Registered: September 2020
Junior Member
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 Jun 22 01:59:10 GMT 2021

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

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

Back to the top