From: Junio C Hamano Date: Thu, 19 May 2011 17:44:33 GMT Subject: Re: [PATCH 1/3] notes remove: allow removing more than one Message-ID: <7vpqne7fge.fsf@alter.siamese.dyndns.org> In-Reply-To: <4DD4C73C.7020600@drmicha.warpmail.net> Michael J Gruber 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 " and "notes list | grep " give quite different results, and "notes list ..." 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 && - >empty && - test_cmp empty actual + git notes list | sed -e "s/ .*//" >actual && + test_cmp after-removal-expect actual ' test_expect_success 'removing is atomic' '