From: larsxschneider@gmail.com
To: git@vger.kernel.org
Cc: peff@peff.net, Lars Schneider <larsxschneider@gmail.com>
Subject: [PATCH v1] convert: add test to demonstrate clean invocations
Date: Thu, 21 Jul 2016 22:59:07 +0200 [thread overview]
Message-ID: <1469134747-26785-1-git-send-email-larsxschneider@gmail.com> (raw)
From: Lars Schneider <larsxschneider@gmail.com>
If three files processed by a filter are added and committed to a
repository then I expect three clean invocations per Git operation.
Apparently Git invokes the clean process 12 times.
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
It's pretty late here and I hope do not miss something obvious... but
can anyone explain to me why the clean operation is executed 12 times
for 3 files?
Thanks,
Lars
t/t0021-conversion.sh | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 7bac2bc..ab3d299 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -12,6 +12,12 @@ tr \
EOF
chmod +x rot13.sh
+cat <<EOF >run.sh
+#!$SHELL_PATH
+ echo "." >> run.count
+EOF
+chmod +x run.sh
+
test_expect_success setup '
git config filter.rot13.smudge ./rot13.sh &&
git config filter.rot13.clean ./rot13.sh &&
@@ -268,4 +274,28 @@ test_expect_success 'disable filter with empty override' '
test_must_be_empty err
'
+test_expect_failure 'required clean filter count' '
+ test_config_global filter.run_count.clean ./../run.sh &&
+ test_config_global filter.run_count.required true &&
+ rm -rf repo &&
+ mkdir repo &&
+ (
+ cd repo &&
+ git init &&
+
+ echo "*.r filter=run_count" >.gitattributes &&
+
+ cat ../test.o >test.r &&
+ echo "test22" >test2.r &&
+ echo "test333" >test3.r &&
+
+ rm -f run.count &&
+ git add . &&
+ test_line_count = 3 run.count
+
+ rm -f run.count &&
+ git commit . -m "test commit" &&
+ test_line_count = 3 run.count
+ )
+'
test_done
--
2.5.1
next reply other threads:[~2016-07-21 20:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-21 20:59 larsxschneider [this message]
2016-07-21 21:37 ` [PATCH v1] convert: add test to demonstrate clean invocations Jeff King
2016-07-22 15:27 ` [PATCH] diff: do not reuse worktree files that need "clean" conversion Jeff King
2016-07-22 17:44 ` Junio C Hamano
2016-07-22 18:10 ` Jeff King
2016-07-22 19:30 ` 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
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=1469134747-26785-1-git-send-email-larsxschneider@gmail.com \
--to=larsxschneider@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).