Gentoo Archives: gentoo-dev

From: Peter Stuge <peter@×××××.se>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: git-r3, additional clone types
Date: Mon, 24 Feb 2014 21:14:13
Message-Id: 20140224211404.12799.qmail@stuge.se
In Reply to: Re: [gentoo-dev] RFC: git-r3, additional clone types by "Michał Górny"
1 Michał Górny wrote:
2 > > > Shallow clone
3 > > > -------------
4 > > > - EGIT_COMMIT can only name tags (using a hash auto-forces higher mode),
5 >
6 > Limitation of git design. You can only fetch remote refs, you can't
7 > fetch an arbitrary hash.
8
9 Ok. Boo git.
10
11
12 > > If it's the same local repo then at least in theory all existing
13 > > blobs and trees don't strictly need to be transfered, only unseen
14 > > ones and all the refs. But I'm not sure if git is so good at dealing
15 > > with this - I haven't looked at exactly how packs are structured.
16 >
17 > It's not good at all. In fact, if you try to update a shallow clone
18 > with 'git fetch --depth 1', it's going to refetch all the objects
19 > (while plain 'git fetch' only downloads new objects). It's just
20 > another limitation of protocol that we can't do much about.
21
22 Do you know if it is indeed the protocol (packs, or something else)
23 or the git implementation which has the limitation?
24
25
26 > > I would prefer if I needed to allow such mode upgrades explicitly.
27 >
28 > That sounds like a lot ebuilds failing, requesting you to explicitly
29 > change the mode.
30
31 I think that's OK. If I've set a mode then I prefer failures over an
32 eclass automagically modifying my setting.
33
34
35 > For example, all Google Code hosted repositories do not support
36 > shallow mode.
37
38 It might be cool to include knowledge about this in the eclss for
39 telling the user about the situation, and later on perhaps even allow
40 setting mode per-hoster in addition to per-ebuild.
41
42
43 > Some projects may require single-branch mode to handle their 'git log'
44 > play.
45
46 That would be for the ebuilds to indicate then. Again, I prefer a
47 deterministic failure when what I have explicitly configured is not
48 possible.
49
50
51 > > > When mirror or single-branch mode is used on a shallow repository,
52 > > > the repository is still marked 'shallow' even if the full history is
53 > > > available. I don't know if this wouldn't break some of 'git foo' uses
54 > > > in the checkout but that probably can't be predicted.
55 > >
56 > > If each mode uses a different remote name (but same URL) then I don't
57 > > think anything can break.
58 >
59 > Remote names are just aliases for URIs. They are meaningless and we
60 > don't even bother using them. Well, actually I may add 'git remote'
61 > since that doesn't hurt but it's a completely unrelated topic.
62
63 Ah, I guess it depends on what exactly is fetched to what. I assumed
64 that local repos would keep remote branches similar to what git does
65 by default.
66
67 My point was that if that were the case, and if each mode used its
68 own remote name, then mix-and-match fetching couldn't break.
69
70
71 Thanks
72
73 //Peter

Replies

Subject Author
Re: [gentoo-dev] RFC: git-r3, additional clone types "Michał Górny" <mgorny@g.o>
Re: [gentoo-dev] RFC: git-r3, additional clone types "Michał Górny" <mgorny@g.o>