On Fri, Aug 28, 2015 at 1:40 PM,  <cov...@ccs.covici.com> wrote:
> Rich Freeman <ri...@gentoo.org> wrote:
>
>> On Fri, Aug 28, 2015 at 11:20 AM, Philip Webb <purs...@ca.inter.net> wrote:
>> > 150828 Rich Freeman wrote:
>> >
>> >> git whatchanged /usr/portage/sys-libs/ncurses > /tmp/log.txt
>> >
>> > Tested as user :
>> >
>> >   690: ~> git whatchanged /usr/portage/sys-libs/ncurses > tmp/log.txt
>> >   fatal: Not a git repository (or any parent up to mount point /home)
>> >   Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not 
>> > set).
>>
>> You're probably not using git to fetch your portage tree.
>>
>> cat /etc/portage/repos.conf/gentoo.conf
>> [DEFAULT]
>> main-repo = gentoo
>>
>> [gentoo]
>> location = /usr/portage
>> sync-type = git
>> sync-uri = https://github.com/gentoo-mirror/gentoo.git
>> auto-sync = yes
>>
>> Fix that and you'll be fine.  Be aware that you're not going to have
>> any changelogs once you do this.  I'm not certain but you might have
>> to delete /usr/portage first - I have no idea how it handles existing
>> files.
>
> So, will I be able to see a git log for the packages?  Otherwise, what
> is the advantage of doing this?  Will I see git logs for the ebuilds
> only?

If you sync using git then you'll have a full clone of the Gentoo
repository on your drive.  Over time it will take more space, which is
the main downside (though I believe gentoo does a shallow clone by
default with no history).

You can see a git log for whatever you want.  git log will show you
every commit in the tree.  git log . will show you every commit that
affects the current directory or below.  And so on.  It does
everything a changelog does and more, and the same data will be used
to generate future changelogs.

I believe it is a shallow clone so on day 1 you actually won't see any
history.  You'll just see a log of future changes, which is probably
what interests a sysadmin most.  If you want the last few weeks of
changes you can fetch the full history with git fetch --unshallow.
You can also do things like git fetch --depth=n which will fetch or
discard commits to reach a given depth (so you could have a cron job
that discards down to 1000 commits once a week or whatever).

Since rsync time has been a discussion point on the list, I'll also
point out that git syncs are likely to be much faster if you rsync
regularly (daily-to-monthly).  Git knows exactly what changed from the
log - it doesn't have to stat every inode in /usr/portage to figure
out what is out of date.  If you only sync once a year then rsync will
be faster since it doesn't end up fetching every file that was added
to the tree and then removed six months later between your last sync
and today.

The git URI I posted above includes metadata, so it isn't quite the
live tree.  You can sync the actual live tree but then you'll need to
run egencache --update --repo gentoo to generate metadata if you use
eix or to make emerge go faster.  That isn't necessary if you use the
example above.

But, using git isn't the normal new-user experience, so don't expect
lots of news/etc if the URI changes and so on.  I'd think that anybody
who likes to look at changelogs is going to like using git once they
get used to it.  Honestly, if you're the sort that likes reading
changelogs then you probably should be putting /etc in git, perhaps
using sys-apps/etckeeper to do it.

-- 
Rich

Reply via email to