{"thread":{"id":"17619","subject":"[PATCH v2 0/2] git notes show: handle empty notes gracefully","startedAt":"2009-02-06T16:17:53Z","lastAt":"2009-02-14T17:46:36Z","messageCount":4,"participants":["Michael J Gruber","Thomas Rast"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"103524","messageId":"1233937075-31194-1-git-send-email-git@drmicha.warpmail.net","threadId":"17619","inReplyTo":null,"subject":"[PATCH v2 0/2] git notes show: handle empty notes gracefully","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-02-06T16:17:53Z","receivedAt":"2009-02-06T16:17:53Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"\"git notes show\" barks when there is no note to show. This introduces a\ntest (yes, a test!) and, in a second round, reacts more gracefully to\nempty notes and adjust the expected test output accordingly.\n\nNote that in both cases (before/after the patch) the return code is\nnon-zero: It's 128 in the ungraceful case, 1 when \"dieing gracefully\",\nuhm...\n\nThe main achivement in v2 is the correction of typos in the commit\nmessages and comments, as well as the addition of proper s-o-b (son of\na...) lines.\n\nAdditionally, v2 incorporates input from the two J's. We test explicitly\nfor return code 1 now.\n\nMichael J Gruber (2):\n  git notes show: test empty notes\n  handle empty notes gracefully\n\n git-notes.sh     |    2 ++\n t/t3301-notes.sh |    5 +++++\n 2 files changed, 7 insertions(+), 0 deletions(-)\n"},{"id":"103525","messageId":"1233937075-31194-2-git-send-email-git@drmicha.warpmail.net","threadId":"17619","inReplyTo":"1233937075-31194-1-git-send-email-git@drmicha.warpmail.net","subject":"[PATCH v2 1/2] git notes show: test empty notes","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-02-06T16:17:54Z","receivedAt":"2009-02-06T16:17:54Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Add a test for the handling of empty notes by \"git notes show\".\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n t/t3301-notes.sh |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex 9393a25..7ef1c29 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -35,6 +35,11 @@ test_expect_success 'need valid notes ref' '\n \t! MSG=2 GIT_NOTES_REF='/' git notes show\n '\n \n+# 1 indicates caught gracefully by die, 128 means git-show barked\n+test_expect_failure 'handle empty notes gracefully' '\n+\tgit notes show ; test 1 = $?\n+'\n+\n test_expect_success 'create notes' '\n \tgit config core.notesRef refs/notes/commits &&\n \tMSG=b1 git notes edit &&\n-- \n1.6.1.2.253.ga34a\n"},{"id":"103526","messageId":"1233937075-31194-3-git-send-email-git@drmicha.warpmail.net","threadId":"17619","inReplyTo":"1233937075-31194-2-git-send-email-git@drmicha.warpmail.net","subject":"[PATCH v2 2/2] handle empty notes gracefully","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-02-06T16:17:55Z","receivedAt":"2009-02-06T16:17:55Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Currently, git-notes barks when asked to show an empty (i.e.\nnon-existing) note. Change this to explicitly say there is none.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n git-notes.sh     |    2 ++\n t/t3301-notes.sh |    2 +-\n 2 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/git-notes.sh b/git-notes.sh\nindex bfdbaa8..9cbad02 100755\n--- a/git-notes.sh\n+++ b/git-notes.sh\n@@ -58,6 +58,8 @@ edit)\n \t\t\"$GIT_NOTES_REF\" $NEW_HEAD $CURRENT_HEAD\n ;;\n show)\n+\tgit rev-parse -q --verify \"$GIT_NOTES_REF\":$COMMIT > /dev/null ||\n+\t\tdie \"No note for commit $COMMIT.\"\n \tgit show \"$GIT_NOTES_REF\":$COMMIT\n ;;\n *)\ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex 7ef1c29..ff4ea05 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -36,7 +36,7 @@ test_expect_success 'need valid notes ref' '\n '\n \n # 1 indicates caught gracefully by die, 128 means git-show barked\n-test_expect_failure 'handle empty notes gracefully' '\n+test_expect_success 'handle empty notes gracefully' '\n \tgit notes show ; test 1 = $?\n '\n \n-- \n1.6.1.2.253.ga34a\n"},{"id":"104652","messageId":"200902141846.49961.trast@student.ethz.ch","threadId":"17619","inReplyTo":"1233937075-31194-1-git-send-email-git@drmicha.warpmail.net","subject":"Re: [PATCH v2 0/2] git notes show: handle empty notes gracefully","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-14T17:46:36Z","receivedAt":"2009-02-14T17:46:36Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Michael J Gruber wrote:\n> Michael J Gruber (2):\n>   git notes show: test empty notes\n>   handle empty notes gracefully\n\nTested-by: Thomas Rast <trast@student.ethz.ch>\n\nThe previous message was especially annoying because it would fire up\nthe pager on narrow terminals.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"}]}