From: Jeff King <peff@peff.net>
To: Michael Edgar <adgar@google.com>
Cc: git@vger.kernel.org, pclouds@gmail.com
Subject: Re: [PATCH] clone: check if server supports shallow clones
Date: Wed, 10 Jun 2015 16:56:08 -0400 [thread overview]
Message-ID: <20150610205607.GA25842@peff.net> (raw)
In-Reply-To: <CALkbG6+Xqw+giW3msUKYx4odFv+2GAi=C2t2d=6VjuFp0xpO0w@mail.gmail.com>
On Wed, Jun 10, 2015 at 04:25:45PM -0400, Michael Edgar wrote:
> > On Wed, Jun 10, 2015 at 3:05 PM, Jeff King <peff@peff.net> wrote:
> > I see that do_fetch_pack checks server_supports("shallow"). Is that
> > enough to cover all fetch cases? And if it is, why does it not cover the
> > matching clone cases?
> > -Peff
>
> Great question. I determined that the do_fetch_pack logic doesn't work for
> clones because it also checks is_repository_shallow(), which looks for the
> .git/shallow file (or the alternate file).
>
> I considered changing clone to create an empty .git/shallow file or alternate,
> but it turns out that an empty shallow file is treated as no shallow file at
> all. Since at this stage in cloning we have nothing to put in the shallow file,
> it seemed like any other fix would require more substantial changes.
Hmm. Can we improve the check in do_fetch_pack? That is, do we have a
way of checking whether the _current_ fetch is going to make us shallow?
I don't see anything obvious (like a "depth" flag) passed into
do_fetch_pack, so I guess it is relying solely on global shallow state
that we've already set up? Or is it the case that "git fetch
--depth=" in a non-shallow repository does not properly check this flag?
If it turns out that "fetch --depth" is fine, and only "clone --depth"
is broken, I can certainly live with the patch you provided. But I think
we need to clarify that a bit in the commit message.
-Peff
next prev parent reply other threads:[~2015-06-10 20:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 18:35 [PATCH] clone: check if server supports shallow clones Mike Edgar
2015-06-10 19:05 ` Jeff King
2015-06-10 20:25 ` Michael Edgar
2015-06-10 20:56 ` Jeff King [this message]
2015-06-11 13:02 ` Duy Nguyen
2015-06-11 14:32 ` Jeff King
2015-06-11 18:18 ` Michael Edgar
2015-06-11 20:44 ` Junio C Hamano
2015-06-17 11:48 ` [PATCH v2] fetch-pack: check for shallow if depth given Mike Edgar
2015-06-17 17:00 ` Jeff King
2015-06-17 16:35 ` [PATCH] clone: check if server supports shallow clones Junio C Hamano
2015-06-17 16:59 ` 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=20150610205607.GA25842@peff.net \
--to=peff@peff.net \
--cc=adgar@google.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.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 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.