Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ncurses: reductio ad absurdum
Date: Fri, 28 Aug 2015 18:47:29
Message-Id: CAGfcS_=saybMK2nV-_9MON55P+coXPFMvc=vWRVWQG0O9j+VOg@mail.gmail.com
In Reply to: Re: [gentoo-user] ncurses: reductio ad absurdum by covici@ccs.covici.com
1 On Fri, Aug 28, 2015 at 1:40 PM, <covici@××××××××××.com> wrote:
2 > Rich Freeman <rich0@g.o> wrote:
3 >
4 >> On Fri, Aug 28, 2015 at 11:20 AM, Philip Webb <purslow@××××××××.net> wrote:
5 >> > 150828 Rich Freeman wrote:
6 >> >
7 >> >> git whatchanged /usr/portage/sys-libs/ncurses > /tmp/log.txt
8 >> >
9 >> > Tested as user :
10 >> >
11 >> > 690: ~> git whatchanged /usr/portage/sys-libs/ncurses > tmp/log.txt
12 >> > fatal: Not a git repository (or any parent up to mount point /home)
13 >> > Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
14 >>
15 >> You're probably not using git to fetch your portage tree.
16 >>
17 >> cat /etc/portage/repos.conf/gentoo.conf
18 >> [DEFAULT]
19 >> main-repo = gentoo
20 >>
21 >> [gentoo]
22 >> location = /usr/portage
23 >> sync-type = git
24 >> sync-uri = https://github.com/gentoo-mirror/gentoo.git
25 >> auto-sync = yes
26 >>
27 >> Fix that and you'll be fine. Be aware that you're not going to have
28 >> any changelogs once you do this. I'm not certain but you might have
29 >> to delete /usr/portage first - I have no idea how it handles existing
30 >> files.
31 >
32 > So, will I be able to see a git log for the packages? Otherwise, what
33 > is the advantage of doing this? Will I see git logs for the ebuilds
34 > only?
35
36 If you sync using git then you'll have a full clone of the Gentoo
37 repository on your drive. Over time it will take more space, which is
38 the main downside (though I believe gentoo does a shallow clone by
39 default with no history).
40
41 You can see a git log for whatever you want. git log will show you
42 every commit in the tree. git log . will show you every commit that
43 affects the current directory or below. And so on. It does
44 everything a changelog does and more, and the same data will be used
45 to generate future changelogs.
46
47 I believe it is a shallow clone so on day 1 you actually won't see any
48 history. You'll just see a log of future changes, which is probably
49 what interests a sysadmin most. If you want the last few weeks of
50 changes you can fetch the full history with git fetch --unshallow.
51 You can also do things like git fetch --depth=n which will fetch or
52 discard commits to reach a given depth (so you could have a cron job
53 that discards down to 1000 commits once a week or whatever).
54
55 Since rsync time has been a discussion point on the list, I'll also
56 point out that git syncs are likely to be much faster if you rsync
57 regularly (daily-to-monthly). Git knows exactly what changed from the
58 log - it doesn't have to stat every inode in /usr/portage to figure
59 out what is out of date. If you only sync once a year then rsync will
60 be faster since it doesn't end up fetching every file that was added
61 to the tree and then removed six months later between your last sync
62 and today.
63
64 The git URI I posted above includes metadata, so it isn't quite the
65 live tree. You can sync the actual live tree but then you'll need to
66 run egencache --update --repo gentoo to generate metadata if you use
67 eix or to make emerge go faster. That isn't necessary if you use the
68 example above.
69
70 But, using git isn't the normal new-user experience, so don't expect
71 lots of news/etc if the URI changes and so on. I'd think that anybody
72 who likes to look at changelogs is going to like using git once they
73 get used to it. Honestly, if you're the sort that likes reading
74 changelogs then you probably should be putting /etc in git, perhaps
75 using sys-apps/etckeeper to do it.
76
77 --
78 Rich