Pre-receive hook always reject the push to the remote repository #3007

Closed
opened 2025-11-02 04:57:08 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @parambath92 on GitHub (Mar 6, 2019).

Pre-receive hook under gitea has a shell script which is working. But after updating and resynchronizing pre-receive the hook it rejects all the push from the local repo even after giving the correct commit message matching the regular expression. The script is as shown:

#!/usr/bin/env bash
INPUT_FILE=$1
START_LINE=`head -n1 $INPUT_FILE`
PATTERN="^(PROJ):"
if ! [[ "$START_LINE" =~ $PATTERN ]]; then
  echo "Your commit message is not formatted correctly. Your message should be in the format: ('PROJ: commit message’)"
  exit 1
fi
Originally created by @parambath92 on GitHub (Mar 6, 2019). Pre-receive hook under gitea has a shell script which is working. But after updating and resynchronizing pre-receive the hook it rejects all the push from the local repo even after giving the correct commit message matching the regular expression. The script is as shown: ```bash #!/usr/bin/env bash INPUT_FILE=$1 START_LINE=`head -n1 $INPUT_FILE` PATTERN="^(PROJ):" if ! [[ "$START_LINE" =~ $PATTERN ]]; then echo "Your commit message is not formatted correctly. Your message should be in the format: ('PROJ: commit message’)" exit 1 fi ```
Author
Owner

@stale[bot] commented on GitHub (May 6, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (May 6, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@lunny commented on GitHub (May 6, 2019):

Need more detail to reproduce.

@lunny commented on GitHub (May 6, 2019): Need more detail to reproduce.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3007