All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/3] notes remove: allow removing more than one
Date: Thu, 19 May 2011 10:44:33 -0700	[thread overview]
Message-ID: <7vpqne7fge.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4DD4C73C.7020600@drmicha.warpmail.net> (Michael J. Gruber's message of "Thu, 19 May 2011 09:31:08 +0200")

Michael J Gruber <git@drmicha.warpmail.net> writes:

> The test has two notes because it was created when remove would remove
> one note at a time only, and the test made sure it did not remove the
> other one (!).

Fair enough.  Here is an incremental update to be squashed in.

I notice that "notes list <commit>" and "notes list | grep <commit>" give
quite different results, and "notes list <commit1> <commit2>..." does not
even work at all. Probably the "notes" interface was done with interactive
use in mind without realizing the need for batch operations.

 t/t3301-notes.sh |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 6a6daa9..6278fe8 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -438,12 +438,13 @@ test_expect_success 'removing non-existing note should not create new commit' '
 test_expect_success 'removing more than one' '
 	before=$(git rev-parse --verify refs/notes/commits) &&
 	test_when_finished "git update-ref refs/notes/commits $before" &&
+
+	# We have only two -- add another and make sure it stays
+	git notes add -m "extra" &&
+	git notes list HEAD >after-removal-expect &&
 	git notes remove HEAD^^ HEAD^^^ &&
-	git diff --name-only refs/notes/commits^ refs/notes/commits >actual &&
-	test 2 = $(wc -l <actual) &&
-	git ls-tree -r --name-only refs/notes/commits >actual &&
-	>empty &&
-	test_cmp empty actual
+	git notes list | sed -e "s/ .*//" >actual &&
+	test_cmp after-removal-expect actual
 '
 
 test_expect_success 'removing is atomic' '

  reply	other threads:[~2011-05-19 17:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19  0:14 [PATCH 0/3] "git notes remove" updates Junio C Hamano
2011-05-19  0:14 ` [PATCH 1/3] notes remove: allow removing more than one Junio C Hamano
2011-05-19  6:43   ` Michael J Gruber
2011-05-19  6:50     ` Junio C Hamano
2011-05-19  7:31       ` Michael J Gruber
2011-05-19 17:44         ` Junio C Hamano [this message]
2011-05-19 18:47         ` [PATCH 1/2] fixup! notes remove: --ignore-missing Michael J Gruber
2011-05-19 18:47           ` [PATCH 2/2] fixup! notes remove: --stdin reads from the standard input Michael J Gruber
2011-05-19  0:14 ` [PATCH 2/3] notes remove: --missing-ok Junio C Hamano
2011-05-19  2:00   ` Junio C Hamano
2011-05-19  0:14 ` [PATCH 3/3] notes remove: --stdin reads from the standard input Junio C Hamano
2011-05-19  6:50   ` Michael J Gruber
2011-05-19 10:50   ` Jeff King
2011-05-19 17:55     ` Junio C Hamano
2011-05-19 18:02       ` Jeff King
2011-05-19  2:03 ` [PATCH 4/3] show: --ignore-missing Junio C Hamano
2011-05-19  7:08 ` [PATCH 0/3] "git notes remove" updates Johan Herland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vpqne7fge.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.