git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCHv2 1/2] git-patch-id: test for "no newline" markers
Date: Thu, 17 Feb 2011 08:44:41 +0100	[thread overview]
Message-ID: <d27aa07556df763b34b980d3706320216094d592.1297928549.git.git@drmicha.warpmail.net> (raw)
In-Reply-To: <7vwrkziw2i.fsf@alter.siamese.dyndns.org>

Currently, patch-id trips over our very own diff extension for marking
the absence of newline at EOF.

Expose this in a test.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/t4204-patch-id.sh |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh
index 68e2652..db96064 100755
--- a/t/t4204-patch-id.sh
+++ b/t/t4204-patch-id.sh
@@ -63,4 +63,40 @@ test_expect_success 'patch-id supports git-format-patch MIME output' '
 	test_cmp patch-id_master patch-id_same
 '
 
+cat >nonl <<\EOF
+diff --git i/a w/a
+index e69de29..2e65efe 100644
+--- i/a
++++ w/a
+@@ -0,0 +1 @@
++a
+\ No newline at end of file
+diff --git i/b w/b
+index e69de29..6178079 100644
+--- i/b
++++ w/b
+@@ -0,0 +1 @@
++b
+EOF
+
+cat >withnl <<\EOF
+diff --git i/a w/a
+index e69de29..7898192 100644
+--- i/a
++++ w/a
+@@ -0,0 +1 @@
++a
+diff --git i/b w/b
+index e69de29..6178079 100644
+--- i/b
++++ w/b
+@@ -0,0 +1 @@
++b
+EOF
+
+test_expect_failure 'patch-id handles no-nl-at-eof markers' '
+	cat nonl | calc_patch_id nonl &&
+	cat withnl | calc_patch_id withnl &&
+	test_cmp patch-id_nonl patch-id_withnl
+'
 test_done
-- 
1.7.4.1.74.gf39475.dirty

  reply	other threads:[~2011-02-17  7:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 14:56 Why does git-patch-id(1) sometimes print two lines, one of which has commit = 0000000000000000000000000000000000000000 Ævar Arnfjörð Bjarmason
2011-02-16 16:11 ` Michael J Gruber
2011-02-16 16:55   ` [PATCH 1/2] git-patch-id: test for "no newline" markers Michael J Gruber
2011-02-16 16:55     ` [PATCH 2/2] git-patch-id: do not trip over " Michael J Gruber
2011-02-16 20:05       ` Junio C Hamano
2011-02-17  7:44         ` Michael J Gruber [this message]
2011-02-17  7:44           ` [PATCHv2 " Michael J Gruber
2011-02-18  4:16             ` Jeff King
2011-02-18  8:02               ` Michael J Gruber
2011-02-18 10:12                 ` [PATCHv3 1/2] git-patch-id: test for " Michael J Gruber
2011-02-18 10:12                   ` [PATCHv3 2/2] git-patch-id: do not trip over " Michael J Gruber
2011-02-18 10:41                     ` Jeff King
2011-02-18 10:43                       ` Michael J Gruber
2011-02-18 10:47                         ` Jeff King
2011-02-18 14:29                     ` Jakub Narebski
2011-02-18 10:40                 ` [PATCHv2 " Jeff King
2011-02-17 11:55           ` [PATCHv2 1/2] git-patch-id: test for " Jakub Narebski
2011-02-17 12:11             ` Michael J Gruber

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=d27aa07556df763b34b980d3706320216094d592.1297928549.git.git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).