Community
Participate
Working Groups
Created attachment 281336 [details] Pop-up warning message is empty(blank) We used "commit-msg" hook and placed in inside <path2repo>\.git\hooks. During commit of invalid pattern of comment, EGit able to show pop-up window that the commit was rejected by 'commit-msg" hook. However, the warning displays an empty(blank) message. Sample commit-msg script: #!/bin/sh # GIT Hook to test that the user entered a valid comment: # TKT<#>:<TASK#> - Comment # The file name must be "commit-msg" in order for GIT to use it # Extract the part of the comment that includes the TKT# and Task ID RESULT=`grep -r -o "^TKT[0-9]\+:[0-9]\+\s" $1` if [ "$RESULT" = "" ] then RESULT=`grep -r -o "^BUILDER\s" $1` if [ "$RESULT" = "" ] then echo "The comment is missing the prefix of 'TKT<#>:<TASK#>'" exit 1 fi fi exit 0 # Success
Try writing the message to stderr. I think we do have existing bugs about stdout not being shown.[1] [1] https://bugs.eclipse.org/bugs/buglist.cgi?list_id=19125682&longdesc=hook%20stdout&longdesc_type=allwordssubstr&product=EGit&product=JGit&query_format=advanced
Created attachment 281338 [details] fixed - output message to stderr Using stderr (>&2) fixed the empty message. Thank you so much. Script: echo 'The comment is missing the prefix of TKT<PR#>:<TASK#>' >&2