From: Brandon Casey <drafnel@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Brandon Casey <drafnel@gmail.com>
Subject: [PATCH 1/2] t/t5400: demonstrate breakage caused by informational message from prune
Date: Mon, 6 Aug 2012 22:01:48 -0700 [thread overview]
Message-ID: <1344315709-15897-1-git-send-email-drafnel@gmail.com> (raw)
In-Reply-To: <CA+sFfMdXc+usFRnCNVoke91_X2qWZARTvPHO=B7Ukxr-j7JB2g@mail.gmail.com>
When receive-pack triggers 'git gc --auto' and 'git prune' is called to
remove a stale temporary object, 'git prune' prints an informational
message to stdout about the file that it will remove. Since this message
is written to stdout, it is sent back over the transport channel to the git
client which tries to interpret it as part of the pack protocol and then
promptly terminates with a complaint about a protocol error.
Introduce a test which exercises the auto-gc functionality of receive-pack
and demonstrates this breakage.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
t/t5400-send-pack.sh | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index 0eace37..04a8791 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -145,6 +145,41 @@ test_expect_success 'push --all excludes remote-tracking hierarchy' '
)
'
+test_expect_failure 'receive-pack runs auto-gc in remote repo' '
+ rm -rf parent child &&
+ git init parent &&
+ (
+ # Setup a repo with 2 packs
+ cd parent &&
+ echo "Some text" >file.txt &&
+ git add . &&
+ git commit -m "Initial commit" &&
+ git repack -adl &&
+ echo "Some more text" >>file.txt &&
+ git commit -a -m "Second commit" &&
+ git repack
+ ) &&
+ cp -a parent child &&
+ (
+ # Set the child to auto-pack if more than one pack exists
+ cd child &&
+ git config gc.autopacklimit 1 &&
+ git branch test_auto_gc &&
+ # And create a file that follows the temporary object naming
+ # convention for the auto-gc to remove
+ : >.git/objects/tmp_test_object &&
+ test-chmtime =-1209601 .git/objects/tmp_test_object
+ ) &&
+ (
+ cd parent &&
+ echo "Even more text" >>file.txt &&
+ git commit -a -m "Third commit" &&
+ git send-pack ../child HEAD:refs/heads/test_auto_gc >output 2>&1 &&
+ grep "Auto packing the repository for optimum performance." output
+ ) &&
+ test ! -e child/.git/objects/tmp_test_object
+'
+
rewound_push_setup() {
rm -rf parent child &&
mkdir parent &&
--
1.7.12.rc1.17.g9a7365c
next prev parent reply other threads:[~2012-08-07 5:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-05 1:55 Did we break receive-pack recently? Junio C Hamano
2012-08-06 1:37 ` Brandon Casey
2012-08-06 3:32 ` Brandon Casey
2012-08-07 5:01 ` Brandon Casey [this message]
2012-08-07 5:01 ` [PATCH 2/2] prune.c: only print informational message in show_only or verbose mode Brandon Casey
2012-08-07 5:28 ` Junio C Hamano
2012-08-07 5:34 ` Junio C Hamano
2012-08-07 5:44 ` Brandon Casey
2012-08-07 6:03 ` Jeff King
2012-08-07 6:33 ` Brandon Casey
2012-08-07 15:41 ` Junio C Hamano
2012-08-07 21:44 ` Junio C Hamano
2012-08-07 21:59 ` Jeff King
2012-08-07 22:55 ` Brandon Casey
2012-08-07 5:32 ` Jeff King
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=1344315709-15897-1-git-send-email-drafnel@gmail.com \
--to=drafnel@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.
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).