Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] RFC: Patch set for git-r3 enabling full mirroring of upstream repo
Date: Fri, 21 Feb 2014 20:08:21
Message-Id: 20140221210754.2867562e@pomiot.lan
1 Hello,
2
3 Many people found the current behavior of git-r3 eclass unfortunate,
4 lightly saying. Most importantly, I underestimated how many packages
5 actually require pretty complete '.git' metadata in the checkout,
6 including complete history. Most of it was collected in bug #489100
7 [1].
8
9 I've finally found time to get around and rewrite git-r3 to properly
10 support all those use cases. I'd like to submit patches implementing
11 that for the mailing list discussion.
12
13 It is an important change of the eclass behavior. Previously it aimed
14 at downloading minimal amount of data necessary for checking out
15 the requested tree version. The new version mirrors complete upstream
16 repository, including all branches and tags. It also ensures that
17 a proper complete '.git' directory resides in the checkout.
18
19 Patch #1 removes shallow clone support completely, and uses full
20 mirroring instead. The new code would require even more conditionals to
21 keep the two different behaviors around, and considering the negative
22 reception it had I don't feel like maintaining the extra code is worth
23 the effort.
24
25 Patch #2 switches the internal git-r3 refs that are used to track
26 changes between updates from 'refs/heads' namespace to dedicated
27 'refs/git-r3'. Long story short, this prevents 'git fetch --prune' from
28 removing them on next fetch and makes 'git clone' ignore them when
29 cloning the repository.
30
31 Patch #3 actually makes checkout clone the repository rather than hack
32 it around in order to perform the checkout. It gives all the nice
33 '.git' structure build systems want, and also removes the need to use
34 lock files.
35
36 Patch #4 introduces some more black magic between fetch & checkout.
37 Long story short, it makes passing refs (rather than commit ids)
38 possible to checkout, and 'git branch' reports the correct branch
39 rather than 'detached ...' state.
40
41 Attaching the complete eclass for easier reading as well. Please review.
42
43 [1]:https://bugs.gentoo.org/show_bug.cgi?id=489100
44
45 --
46 Best regards,
47 Michał Górny

Attachments

File name MIME type
0001-Remove-shallow-clone-support-always-use-full-clones.patch text/x-patch
0002-Use-dedicated-refs-rather-than-branches-for-eclass-d.patch text/x-patch
0003-Clone-the-repository-into-working-directory.patch text/x-patch
0004-Pass-branches-and-tags-as-symbolic-refs.patch text/x-patch
git-r3.eclass text/plain
signature.asc application/pgp-signature

Replies