Skip to contentSkip to conversation

update hook: redirect _both_ diagnostic lines to stderr upon tag failure

PATCH In review Jim Meyering 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 update hook: redirect _both_ diagnostic lines to stderr upon tag failure

Otherwise, sending the diagnostic to stdout would provoke a protocol failure.

---
 templates/hooks--update |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
templates/hooks--update +1 -1
index 76d5ac2..9863a80 100644
@@ -19,7 +19,7 @@ # Remove this code to treat dumb tags th
 case "$1","$ref_type" in
 refs/tags/*,commit)
 	echo "*** Un-annotated tags are not allowed in this repo" >&2
-	echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate."
+	echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
 	exit 1;;
 refs/tags/*,tag)
 	echo "### Pushing version '${1##refs/tags/}' to the masses" >&2

--
1.4.2.GIT

#1 lore raw
Quoted 1 line · Jim Meyering

Otherwise, sending the diagnostic to stdout would provoke a protocol failure.

Very true; thanks for the patch.

However, I suspect that we'd want to prevent this by redirecting on the caller side, so that the hook writers do not have to worry about the issue. I haven't looked at the code that runs the hook for some time but we should be able to do that...