From: Duy Nguyen <pclouds@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Ramkumar Ramachandra <artagnon@gmail.com>,
Martin Fick <mfick@codeaurora.org>
Subject: Re: [PATCH] push: respect --no-thin
Date: Sat, 10 Aug 2013 18:45:15 +0700 [thread overview]
Message-ID: <20130810114515.GA14027@lanh> (raw)
In-Reply-To: <20130810103123.GB6237@sigill.intra.peff.net>
On Sat, Aug 10, 2013 at 06:31:23AM -0400, Jeff King wrote:
> It might be nice to have a test, but I am not sure of a good way to
> check whether a push was thin. I guess we can grep the output of
> GIT_TRACE, though it feels a bit hacky.
In theory, if we have a way to tell receive-pack not to pass
--fix-thin to index-pack, then it should barf on the thin pack
received from push/send-pack. But it does not work this way, or at
least I set up the test the wrong way, or pack-objects decides not to
create deltas.. anybody sees what's wrong in this test?
-- 8< --
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index e3eb5fc..da60817 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -38,6 +38,7 @@ static int quiet;
static int prefer_ofs_delta = 1;
static int auto_update_server_info;
static int auto_gc = 1;
+static int fix_thin = 1;
static const char *head_name;
static void *head_name_to_free;
static int sent_capabilities;
@@ -869,7 +870,8 @@ static const char *unpack(int err_fd)
keeper[i++] = "--stdin";
if (fsck_objects)
keeper[i++] = "--strict";
- keeper[i++] = "--fix-thin";
+ if (fix_thin)
+ keeper[i++] = "--fix-thin";
keeper[i++] = hdr_arg;
keeper[i++] = keep_arg;
keeper[i++] = NULL;
@@ -975,6 +977,10 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
stateless_rpc = 1;
continue;
}
+ if (!strcmp(arg, "--no-thin")) {
+ fix_thin = 0;
+ continue;
+ }
usage(receive_pack_usage);
}
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 4691d51..9c9d43c 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -126,6 +126,16 @@ test_expect_success setup '
'
+test_expect_success 'push --no-thin' '
+ git init no-thin &&
+ git --git-dir=no-thin/.git config receive.unpacklimit 0 &&
+ git push no-thin/.git refs/heads/master:refs/heads/foo &&
+ echo modified >> path1 &&
+ git commit -am modified &&
+ git push --no-thin --receive-pack="git receive-pack --no-thin" no-thin/.git refs/heads/master:refs/heads/foo
+ false
+'
+
test_expect_success 'fetch without wildcard' '
mk_empty testrepo &&
(
-- 8< --
next prev parent reply other threads:[~2013-08-10 11:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-10 10:10 [PATCH] push: respect --no-thin Nguyễn Thái Ngọc Duy
2013-08-10 10:31 ` Jeff King
2013-08-10 11:45 ` Duy Nguyen [this message]
2013-08-11 1:24 ` [PATCH v2] " Nguyễn Thái Ngọc Duy
2013-08-11 5:12 ` Eric Sunshine
2013-08-11 8:52 ` [PATCH v3] " Nguyễn Thái Ngọc Duy
2013-08-12 5:59 ` Junio C Hamano
2013-08-12 11:30 ` Duy Nguyen
2013-08-13 16:43 ` Junio C Hamano
2013-08-12 13:55 ` [PATCH v4] " Nguyễn Thái Ngọc Duy
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=20130810114515.GA14027@lanh \
--to=pclouds@gmail.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mfick@codeaurora.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.