output error message to stderr

This commit is contained in:
Balakrishnan Balasubramanian 2024-02-19 15:31:17 -05:00
parent a63fb8e0b0
commit c0904da991

View File

@ -11,6 +11,7 @@ case $GIT_INDEX_FILE in
*.lock)
if GIT_INDEX_FILE=${GIT_INDEX_FILE%.lock} git status --porcelain | grep '^M'
then
exec 1>&2 # Redirect output to stderr.
echo "Error: Found both staged and unstaged changes when trying to commit with 'git commit -a'."
echo "Do two seperate commits with, 'git commit -m ...' and 'git commit -a -m ...'"
echo "Or 'git reset .' and then 'git commit -a -m ...' for a single commit"