Re: git-clone --single-branch clones objects outside of branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 28, 2020 at 1:48 AM Jeff King <peff@xxxxxxxx> 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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux