{"thread":{"id":"43073","subject":"Re: git tag: don't complain of empty messages","startedAt":"2006-11-15T15:34:25Z","lastAt":"2006-11-26T16:46:11Z","messageCount":10,"participants":["Han-Wen Nienhuys","Johannes Schindelin","Junio C Hamano","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"297928","messageId":"ejfc1t$6am$1@sea.gmane.org","threadId":"43073","inReplyTo":null,"subject":"git tag: don't complain of empty messages","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-11-15T15:34:25Z","receivedAt":"2006-11-15T15:34:25Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"\nHello,\n\nGIT refuses to set annotated tags without a comment. I think this is a \nsilly restriction when the message is explicitly set to the empty string.\n\nThe attached patch should fix this;  Unfortunately, I've been unable to \ntest it. Running the script with sh -x stops at\n\n++exec /home/hanwen/usr/pkg/git/bin/git-sh-setup\n\n-- \n  Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n\n\ncommit 446cfbd9edcfaf5fe76f597823e0e3314d091489\nAuthor: Han-Wen Nienhuys <hanwen@lilypond.org>\nDate:   Wed Nov 15 16:27:27 2006 +0100\n\n    always set tag if -m is given, even if empty\n\ndiff --git a/git-tag.sh b/git-tag.sh\nindex ac269e3..f2533a3 100755\n--- a/git-tag.sh\n+++ b/git-tag.sh\n@@ -5,6 +5,7 @@ USAGE='-l [<pattern>] | [-a | -s | -u <k\n SUBDIRECTORY_OK='Yes'\n . git-sh-setup\n \n+message_given=\n annotate=\n signed=\n force=\n@@ -37,6 +38,7 @@ do\n     \tannotate=1\n \tshift\n \tmessage=\"$1\"\n+\tmessage_given=1\n \t;;\n     -u)\n \tannotate=1\n@@ -83,7 +85,7 @@ tagger=$(git-var GIT_COMMITTER_IDENT) ||\n trap 'rm -f \"$GIT_DIR\"/TAG_TMP* \"$GIT_DIR\"/TAG_FINALMSG \"$GIT_DIR\"/TAG_EDITMSG' 0\n \n if [ \"$annotate\" ]; then\n-    if [ -z \"$message\" ]; then\n+    if [ -z \"$message_given\" ]; then\n         ( echo \"#\"\n           echo \"# Write a tag message\"\n           echo \"#\" ) > \"$GIT_DIR\"/TAG_EDITMSG\n@@ -95,7 +97,7 @@ if [ \"$annotate\" ]; then\n     grep -v '^#' <\"$GIT_DIR\"/TAG_EDITMSG |\n     git-stripspace >\"$GIT_DIR\"/TAG_FINALMSG\n \n-    [ -s \"$GIT_DIR\"/TAG_FINALMSG ] || {\n+    [ -s \"$GIT_DIR\"/TAG_FINALMSG -o -n \"$message_given\" ] || {\n \techo >&2 \"No tag message?\"\n \texit 1\n     }\n"},{"id":"295159","messageId":"Pine.LNX.4.63.0611151657570.13772@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43073","inReplyTo":"ejfc1t$6am$1@sea.gmane.org","subject":"Re: git tag: don't complain of empty messages","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-15T16:02:31Z","receivedAt":"2006-11-15T16:02:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 15 Nov 2006, Han-Wen Nienhuys wrote:\n\n> GIT refuses to set annotated tags without a comment. I think this is a silly\n> restriction when the message is explicitly set to the empty string.\n\nI think that this behaviour is on purpose: The tag will be identified \n(like all objects in git) by its contents. The rationale: the filename \ndoes not matter, since the tag _object_ is not identified by it. So, in \ncase you lose your .git/refs/tags/ directory, you can still reconstruct \nthe tags with \"git-fsck-objects --full\".\n\nCiao,\nDscho\n"},{"id":"294326","messageId":"455B3AC2.10107@xs4all.nl","threadId":"43073","inReplyTo":"Pine.LNX.4.63.0611151657570.13772@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: git tag: don't complain of empty messages","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-11-15T16:05:22Z","receivedAt":"2006-11-15T16:05:22Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Johannes Schindelin escreveu:\n> Hi,\n> \n> On Wed, 15 Nov 2006, Han-Wen Nienhuys wrote:\n> \n>> GIT refuses to set annotated tags without a comment. I think this is a silly\n>> restriction when the message is explicitly set to the empty string.\n> \n> I think that this behaviour is on purpose: The tag will be identified \n> (like all objects in git) by its contents. The rationale: the filename \n> does not matter, since the tag _object_ is not identified by it. So, in \n> case you lose your .git/refs/tags/ directory, you can still reconstruct \n> the tags with \"git-fsck-objects --full\".\n\nWithout a message, the tag can still be identified by its name, which is \nin the tag object contents.\n\n-- \n"},{"id":"297853","messageId":"Pine.LNX.4.63.0611151718220.13772@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43073","inReplyTo":"455B3AC2.10107@xs4all.nl","subject":"Re: git tag: don't complain of empty messages","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-15T16:19:35Z","receivedAt":"2006-11-15T16:19:35Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 15 Nov 2006, Han-Wen Nienhuys wrote:\n\n> Without a message, the tag can still be identified by its name, which is \n> in the tag object contents.\n\nYou are correct. Acked-by: me.\n\nCiao,\nDscho\n"},{"id":"296622","messageId":"7v64dgo9gj.fsf@assigned-by-dhcp.cox.net","threadId":"43073","inReplyTo":"ejfc1t$6am$1@sea.gmane.org","subject":"Re: git tag: don't complain of empty messages","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-15T18:23:24Z","receivedAt":"2006-11-15T18:23:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Han-Wen Nienhuys <hanwen@xs4all.nl> writes:\n\n> Hello,\n>\n> GIT refuses to set annotated tags without a comment. I think this is a\n> silly restriction when the message is explicitly set to the empty\n> string.\n>\n> The attached patch should fix this;  Unfortunately, I've been unable\n> to test it. Running the script with sh -x stops at\n>\n> ++exec /home/hanwen/usr/pkg/git/bin/git-sh-setup\n>\n> -- \n>  Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n> commit 446cfbd9edcfaf5fe76f597823e0e3314d091489\n> Author: Han-Wen Nienhuys <hanwen@lilypond.org>\n> Date:   Wed Nov 15 16:27:27 2006 +0100\n>\n>     always set tag if -m is given, even if empty\n>\n\nPlease follow Documentation/SubmittingPatches.\n\n> diff --git a/git-tag.sh b/git-tag.sh\n> index ac269e3..f2533a3 100755\n> --- a/git-tag.sh\n> +++ b/git-tag.sh\n> @@ -5,6 +5,7 @@ USAGE='-l [<pattern>] | [-a | -s | -u <k\n>  SUBDIRECTORY_OK='Yes'\n>  . git-sh-setup\n>  \n> +message_given=\n>  annotate=\n>  signed=\n>  force=\n> @@ -37,6 +38,7 @@ do\n>      \tannotate=1\n>  \tshift\n>  \tmessage=\"$1\"\n> +\tmessage_given=1\n>  \t;;\n>      -u)\n>  \tannotate=1\n\nIf you are going to do this, this hunk should be changed to\ncheck if the command line ended with \"-m\" without next\nparameter, in which case it should error out.\n\nI do not have a strong objection against allowing tags without\nmessages, but at the same time I do not see a compelling reason\nto allow them either.  Care to explain what workflow is helped\nby an empty tag?\n"},{"id":"295982","messageId":"455BAD80.1080108@xs4all.nl","threadId":"43073","inReplyTo":"7v64dgo9gj.fsf@assigned-by-dhcp.cox.net","subject":"Re: git tag: don't complain of empty messages","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-11-16T00:14:56Z","receivedAt":"2006-11-16T00:14:56Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Junio C Hamano escreveu:\n> I do not have a strong objection against allowing tags without\n> messages, but at the same time I do not see a compelling reason\n> to allow them either.  Care to explain what workflow is helped\n> by an empty tag?\n\nthe tagname usually is enough of a description, but I want the tags to \nend up in the object DB, eg.:\n\n   git tag release/2.10.0 HEAD\n\nnow I have to use\n\n   git tag -m \"this really sucks\"  release/2.10.0 HEAD\n\n\n-- \n"},{"id":"298648","messageId":"ejgbrq$o5u$1@sea.gmane.org","threadId":"43073","inReplyTo":"455BAD80.1080108@xs4all.nl","subject":"Re: git tag: don't complain of empty messages","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-16T00:38:33Z","receivedAt":"2006-11-16T00:38:33Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Han-Wen Nienhuys wrote:\n\n> Junio C Hamano escreveu:\n>> I do not have a strong objection against allowing tags without\n>> messages, but at the same time I do not see a compelling reason\n>> to allow them either.  Care to explain what workflow is helped\n>> by an empty tag?\n> \n> the tagname usually is enough of a description, but I want the tags to \n> end up in the object DB, eg.:\n> \n>    git tag release/2.10.0 HEAD\n> \n> now I have to use\n> \n>    git tag -m \"this really sucks\"  release/2.10.0 HEAD\n\nWhy not\n\n   git tag -m \"release 2.10.0\" release/2.10.0 HEAD\n\nThis way you would know what tag points to even if you loose it's\nreference...\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"293810","messageId":"455BBE89.6070005@xs4all.nl","threadId":"43073","inReplyTo":"ejgbrq$o5u$1@sea.gmane.org","subject":"Re: git tag: don't complain of empty messages","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-11-16T01:27:37Z","receivedAt":"2006-11-16T01:27:37Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Jakub Narebski escreveu:\n> Han-Wen Nienhuys wrote:\n> \n>> Junio C Hamano escreveu:\n>>> I do not have a strong objection against allowing tags without\n>>> messages, but at the same time I do not see a compelling reason\n>>> to allow them either.  Care to explain what workflow is helped\n>>> by an empty tag?\n>> the tagname usually is enough of a description, but I want the tags to \n>> end up in the object DB, eg.:\n>>\n>>    git tag release/2.10.0 HEAD\n>>\n>> now I have to use\n>>\n>>    git tag -m \"this really sucks\"  release/2.10.0 HEAD\n> \n> Why not\n> \n>    git tag -m \"release 2.10.0\" release/2.10.0 HEAD\n> \n> This way you would know what tag points to even if you loose it's\n> reference...\n\nthat would double, given that the tag name is already in the tag object. \nCurrently, I have\n\n**\n[lilydev@haring gub]$ cat .git/refs/tags/gubrelease-2.9.29-2\n1ac5c78609a9f79787825b62c9576542eedce795\n\n\n[lilydev@haring gub]$ git cat-file tag \n1ac5c78609a9f79787825b62c9576542eedce795\n\n\nobject b75db784e3d6a9e1d2cff3f77036aaa88598b53c\ntype commit\ntag gub-2.9.29-2\ntagger Han-Wen Nienhuys <lilydev@haring.localdomain> 1162921716 +0100\n\nbuild and upload\n**\n\n'build and upload' is a polite way of saying 'this really sucks'.\n\n-- \n  Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"295460","messageId":"4569C409.5080509@xs4all.nl","threadId":"43073","inReplyTo":"7v64dgo9gj.fsf@assigned-by-dhcp.cox.net","subject":"Re: git tag: don't complain of empty messages","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-11-26T16:42:49Z","receivedAt":"2006-11-26T16:42:49Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Junio C Hamano escreveu:\n> Please follow Documentation/SubmittingPatches.\n\nSee below, hope I didn't mess up.\n\n\n\nFrom be40730d19592f9db8f07f619f5723060c2f4f0c Mon Sep 17 00:00:00 2001\nFrom: Han-Wen Nienhuys <hanwen@lilypond.org>\nDate: Sun, 26 Nov 2006 17:41:30 +0100\nSubject: [PATCH] allow empty tag message if -m is given explicitly.\n\n---\n git-tag.sh |   11 +++++++++--\n 1 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/git-tag.sh b/git-tag.sh\nindex ac269e3..d53f94c 100755\n--- a/git-tag.sh\n+++ b/git-tag.sh\n@@ -5,6 +5,7 @@ USAGE='-l [<pattern>] | [-a | -s | -u <k\n SUBDIRECTORY_OK='Yes'\n . git-sh-setup\n \n+message_given=\n annotate=\n signed=\n force=\n@@ -37,6 +38,12 @@ do\n     \tannotate=1\n \tshift\n \tmessage=\"$1\"\n+\tif test \"$#\" = \"0\"; then\n+\t    die \"error: option -m needs an argument\"\n+\t    exit 2\n+\telse\n+\t    message_given=1\n+\tfi\n \t;;\n     -u)\n \tannotate=1\n@@ -83,7 +90,7 @@ tagger=$(git-var GIT_COMMITTER_IDENT) ||\n trap 'rm -f \"$GIT_DIR\"/TAG_TMP* \"$GIT_DIR\"/TAG_FINALMSG \"$GIT_DIR\"/TAG_EDITMSG' 0\n \n if [ \"$annotate\" ]; then\n-    if [ -z \"$message\" ]; then\n+    if [ -z \"$message_given\" ]; then\n         ( echo \"#\"\n           echo \"# Write a tag message\"\n           echo \"#\" ) > \"$GIT_DIR\"/TAG_EDITMSG\n@@ -95,7 +102,7 @@ if [ \"$annotate\" ]; then\n     grep -v '^#' <\"$GIT_DIR\"/TAG_EDITMSG |\n     git-stripspace >\"$GIT_DIR\"/TAG_FINALMSG\n \n-    [ -s \"$GIT_DIR\"/TAG_FINALMSG ] || {\n+    [ -s \"$GIT_DIR\"/TAG_FINALMSG -o -n \"$message_given\" ] || {\n \techo >&2 \"No tag message?\"\n \texit 1\n     }\n-- \n1.4.2.4\n\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"294510","messageId":"4569C4D3.5060102@xs4all.nl","threadId":"43073","inReplyTo":"4569C409.5080509@xs4all.nl","subject":"Re: git tag: don't complain of empty messages","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-11-26T16:46:11Z","receivedAt":"2006-11-26T16:46:11Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Han-Wen Nienhuys escreveu:\n> Junio C Hamano escreveu:\n>> Please follow Documentation/SubmittingPatches.\n> \n> See below, hope I didn't mess up.\n\nplease add\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@xs4all.nl>\n\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"}]}