git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Jerdonek <chris.jerdonek@gmail.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: Re: git-clone --single-branch clones objects outside of branch
Date: Tue, 28 Jan 2020 17:59:54 -0800	[thread overview]
Message-ID: <CAOTb1wecnwXrOqJa-dq1zyS1ydgQ-c_b_GX7FkWzJPtGk6xL3g@mail.gmail.com> (raw)
In-Reply-To: <20200128094801.GC574544@coredump.intra.peff.net>

On Tue, Jan 28, 2020 at 1:48 AM Jeff King <peff@peff.net> wrote:
> On Sun, Jan 26, 2020 at 10:46:07PM -0800, Chris Jerdonek wrote:
> > I'm guessing other flags also don't apply when --local is being used.
> > For example, I'm guessing --reference is also ignored when using
> > --local, but I haven't checked yet to confirm. It would be nice if the
> > documentation gave a heads up in cases like these. Even if hard links
> > are being used, it's not clear from the docs whether the objects are
> > filtered first, prior to hard linking, when flags like --single-branch
> > and --reference are passed.
>
> No, "--reference" behaves as usual.

On this, I found that --reference does behave differently in the way
that I suspected. For example, when run with the default --local, I
found that git-clone will create hard links in the new repo to loose
objects, even if those objects already exist in the reference
repository. When run with --non-local, the objects in the reference
repository weren't copied (I didn't find them in the cloned repo's
pack file).

So in addition to --single-branch, this seems to be another case where
`git-clone --local` will ignore the provided options when deciding
what files inside .git/objects/ to hard-link. It just hard-links
everything. This is another example of something that I think would be
worth mentioning in the docs in some form. Currently, the
documentation for --reference suggests that objects won't be created
in the new repo if they already exist in the reference repository.

--Chris

> However, "--depth" is ignored (and
> issues a warning). I don't think it would be wrong to issue a warning
> when --single-branch is used locally (though it would not be "single
> branch is ignored, since it does impact which refs are copied). But I
> kind of wonder if it would be annoying for people who don't care about
> having the extra objects reachable.

  reply	other threads:[~2020-01-29  2:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-26 12:39 git-clone --single-branch clones objects outside of branch Chris Jerdonek
2020-01-27  5:55 ` Jeff King
2020-01-27  6:46   ` Chris Jerdonek
2020-01-28  9:48     ` Jeff King
2020-01-29  1:59       ` Chris Jerdonek [this message]
2020-01-29  2:23         ` 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=CAOTb1wecnwXrOqJa-dq1zyS1ydgQ-c_b_GX7FkWzJPtGk6xL3g@mail.gmail.com \
    --to=chris.jerdonek@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.
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).