git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Schuberth <sschuberth@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, msysgit@googlegroups.com
Subject: Re: [PATCH] blame.c: Properly initialize strbuf after calling, textconv_object()
Date: Fri, 28 Oct 2011 20:36:45 +0200	[thread overview]
Message-ID: <4EAAF63D.7050401@gmail.com> (raw)
In-Reply-To: <7vd3dht4ms.fsf@alter.siamese.dyndns.org>

On 28.10.2011 19:20, Junio C Hamano wrote:

>>>>> Thanks; do you have no addition to the test suite to demonstrate the
>>>>> breakage?
>>>>
>>>> Not yet. I'll try to come up with something.
>>>
>>> Let's do this.
>>
>> Thanks, but that does not seem to work for me. The test breaks both
>> without and with my patch. I'll look into it.
> 
> Thanks. I suspect the difference is because you are on a crlf-native
> platform while I am not...

I also didn't have any luck. I've created a test that should fail without my patch, but it succeeds when running the test script. However, if I copy and paste the lines from the test to the command line, the test fails as expected ("blame" is empty). I'm out of ideas right now.

diff --git a/t/t8006-blame-textconv.sh b/t/t8006-blame-textconv.sh
index 32ec82a..4fee5aa 100755
--- a/t/t8006-blame-textconv.sh
+++ b/t/t8006-blame-textconv.sh
@@ -14,6 +14,13 @@ sed 's/^bin: /converted: /' "$1"
 EOF
 chmod +x helper
 
+cat >helper-dos-line-endings <<'EOF'
+#!/bin/sh
+grep -q '^bin: ' "$1" || { echo "E: $1 is not \"binary\" file" 1>&2; exit 1; }
+sed 's/^bin: \(.*\)$/converted: \1\r/' "$1"
+EOF
+chmod +x helper-dos-line-endings
+
 test_expect_success 'setup ' '
 	echo "bin: test 1" >one.bin &&
 	echo "bin: test number 2" >two.bin &&
@@ -74,6 +81,14 @@ test_expect_success 'blame --textconv going through revisions' '
 	test_cmp expected result
 '
 
+test_expect_success 'blame --textconv with DOS line endings' '
+	git config diff.test.textconv ./helper-dos-line-endings &&
+	git blame --textconv two.bin >blame &&
+	git config diff.test.textconv ./helper &&
+	find_blame <blame >result &&
+	test_cmp expected result
+'
+
 test_expect_success 'setup +cachetextconv' '
 	git config diff.test.cachetextconv true
 '

-- 
Sebastian Schuberth

  reply	other threads:[~2011-10-28 18:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 15:28 [PATCH] blame.c: Properly initialize strbuf after calling, textconv_object() Sebastian Schuberth
2011-10-28 16:00 ` Junio C Hamano
2011-10-28 16:32   ` Sebastian Schuberth
2011-10-28 16:44     ` Junio C Hamano
2011-10-28 17:17       ` Sebastian Schuberth
2011-10-28 17:20         ` Junio C Hamano
2011-10-28 18:36           ` Sebastian Schuberth [this message]
2011-10-31 17:57           ` Sebastian Schuberth

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=4EAAF63D.7050401@gmail.com \
    --to=sschuberth@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=msysgit@googlegroups.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.
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 NNTP newsgroup(s).