Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: peter@×××××.se
Subject: Re: [gentoo-dev] RFC: git-r3, additional clone types
Date: Mon, 24 Feb 2014 21:44:21
Message-Id: 20140224224405.2e05ec87@pomiot.lan
In Reply to: Re: [gentoo-dev] RFC: git-r3, additional clone types by Peter Stuge
1 Dnia 2014-02-24, o godz. 22:14:04
2 Peter Stuge <peter@×××××.se> napisał(a):
3
4 > Michał Górny wrote:
5 > > > If it's the same local repo then at least in theory all existing
6 > > > blobs and trees don't strictly need to be transfered, only unseen
7 > > > ones and all the refs. But I'm not sure if git is so good at dealing
8 > > > with this - I haven't looked at exactly how packs are structured.
9 > >
10 > > It's not good at all. In fact, if you try to update a shallow clone
11 > > with 'git fetch --depth 1', it's going to refetch all the objects
12 > > (while plain 'git fetch' only downloads new objects). It's just
13 > > another limitation of protocol that we can't do much about.
14 >
15 > Do you know if it is indeed the protocol (packs, or something else)
16 > or the git implementation which has the limitation?
17
18 I don't know. I know that the protocol is sending some 'shallow <hash>'
19 thingies in the request but I didn't investigate too much. You can
20 guess what attitude people in #git have when you mention shallow
21 clones...
22
23 > > > > When mirror or single-branch mode is used on a shallow repository,
24 > > > > the repository is still marked 'shallow' even if the full history is
25 > > > > available. I don't know if this wouldn't break some of 'git foo' uses
26 > > > > in the checkout but that probably can't be predicted.
27 > > >
28 > > > If each mode uses a different remote name (but same URL) then I don't
29 > > > think anything can break.
30 > >
31 > > Remote names are just aliases for URIs. They are meaningless and we
32 > > don't even bother using them. Well, actually I may add 'git remote'
33 > > since that doesn't hurt but it's a completely unrelated topic.
34 >
35 > Ah, I guess it depends on what exactly is fetched to what. I assumed
36 > that local repos would keep remote branches similar to what git does
37 > by default.
38 >
39 > My point was that if that were the case, and if each mode used its
40 > own remote name, then mix-and-match fetching couldn't break.
41
42 As soon as you do any fetch with '--depth', git marks the whole
43 repository shallow. Separate branches, remotes, refs don't change this.
44 Though '--unshallow' may help, as Alex noted. Not sure for how long,
45 though.
46
47 --
48 Best regards,
49 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature