From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 4/4] streaming filter: ident filter and filter cascading
Date: Sat, 21 May 2011 23:25:06 +0200 [thread overview]
Message-ID: <4DD82DB2.8000101@lsrfire.ath.cx> (raw)
In-Reply-To: <4DD82931.6000101@lsrfire.ath.cx>
Am 21.05.2011 23:05, schrieb René Scharfe:
> Am 21.05.2011 08:58, schrieb Junio C Hamano:
>> Add support for "ident" filter on the output codepath. Because we now have
>> more than one filter active, also add support to cascade them together.
>>
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>> ---
>>
>> * There is one known issue in this "ident" filter implementation. If the
>> input data ends while the filter is still in the "SKIPPING" state, it
>> should go to the "DRAINING" codepath using the same logic that triggers
>> when it gets to the end of line, copying out what was already queued.
>> However, the API does not offer an explicit way for the input side to
>> say "that's all". We probably need to make a zero-byte input to the
>> filter function as an explicit EOF signal or something---currently I
>> think it will loop forever, but it is getting late, so I will not be
>> further touching this code tonight.
>
> AFAIU it will leave skipping mode once there is no input data anymore
> instead of looping forever. The accumulated stuff will be discarded.
>
> The test suite is passed, by the way, even though t0021 seems to contain
> a test for this issue (NoTerminatingSymbolAtEOF). It uses echo to
> create the files so there will be a terminating newline before the end
> of the file, though, so this subtest probably needs to be changed.
-- >8 --
Subject: t0021-conversion.sh: fix NoTerminatingSymbolAtEOF test
The last line of the test file "expanded-keywords" ended in a newline,
which is a valid terminator for ident. Use printf instead of echo to omit
it and thus really test if a file that ends unexpectedly in the middle of
an ident tag is handled properly.
Also take the oppertunity to calculate the expected ID dynamically
instead of hardcoding it into the test script. This should make future
changes easier.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
t/t0021-conversion.sh | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 9078b84..275421e 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -66,25 +66,26 @@ test_expect_success expanded_in_repo '
echo "\$Id:NoSpaceAtEitherEnd\$"
echo "\$Id: NoTerminatingSymbol"
echo "\$Id: Foreign Commit With Spaces \$"
- echo "\$Id: NoTerminatingSymbolAtEOF"
+ printf "\$Id: NoTerminatingSymbolAtEOF"
} > expanded-keywords &&
+ git add expanded-keywords &&
+ git commit -m "File with keywords expanded" &&
+ id=$(git rev-parse --verify :expanded-keywords) &&
+
{
echo "File with expanded keywords"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
echo "\$Id: NoTerminatingSymbol"
echo "\$Id: Foreign Commit With Spaces \$"
- echo "\$Id: NoTerminatingSymbolAtEOF"
+ printf "\$Id: NoTerminatingSymbolAtEOF"
} > expected-output &&
- git add expanded-keywords &&
- git commit -m "File with keywords expanded" &&
-
echo "expanded-keywords ident" >> .gitattributes &&
rm -f expanded-keywords &&
--
1.7.5.2
next prev parent reply other threads:[~2011-05-21 21:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-21 6:58 [PATCH 0/4] streaming conversion API Junio C Hamano
2011-05-21 6:58 ` [PATCH] convert.h: move declarations for conversion from cache.h Junio C Hamano
2011-05-21 6:58 ` [PATCH 2/4] Add streaming filter API Junio C Hamano
2011-05-21 6:58 ` [PATCH 3/4] Add LF-to-CRLF streaming conversion Junio C Hamano
2011-05-21 6:58 ` [PATCH 4/4] streaming filter: ident filter and filter cascading Junio C Hamano
2011-05-21 21:05 ` René Scharfe
2011-05-21 21:25 ` René Scharfe [this message]
2011-05-25 1:06 ` Junio C Hamano
2011-05-25 2:18 ` [PATCH] t0021: test application of both crlf and ident Junio C Hamano
2011-05-25 2:23 ` [PATCH v2?] streaming: filter cascading Junio C Hamano
2011-05-21 22:08 ` [PATCH 4/4] streaming filter: ident filter and " René Scharfe
2011-05-22 1:00 ` Junio C Hamano
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=4DD82DB2.8000101@lsrfire.ath.cx \
--to=rene.scharfe@lsrfire.ath.cx \
--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.
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).