Gentoo Archives: gentoo-user

From: Marc Joliet <marcec@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Status of a GIT repository
Date: Wed, 20 Dec 2017 10:43:55
Message-Id: 1732829.dOje29DZN5@thetick
In Reply to: Re: [gentoo-user] Status of a GIT repository by "Vadim A. Misbakh-Soloviov"
1 Am Mittwoch, 20. Dezember 2017, 11:28:31 CET schrieb Vadim A. Misbakh-Soloviov:
2 > В письме от среда, 20 декабря 2017 г. 17:04:33 +07 пользователь Helmut
3 >
4 > Jarausch написал:
5 > > Hi,
6 > > I have no experience with GIT.
7 > >
8 > > I'd like to determine if a GIT repository in Gentoo is up-to-date.
9 > > Normally, a GIT folder has a '.git' subfolder. Using 'git status' in
10 > > such a GIT folder works fine.
11 > >
12 > > But the subfolders in /usr/portage/distfiles/git3-src don't contain a
13 > > '.git' subfolder.
14 > > A plain 'git status' in such a subfolder doesn't work - I get "fatal:
15 > > This operation must be run in a work tree".
16 > >
17 > > Is there a means to determine the status of a Gentoo-GIT-folder?
18 > >
19 > > Background: I'd like to check if anything has changed in the GIT
20 > > repository before I run an 'emerge -u' for that.
21 > >
22 > > Many thanks for a hint,
23 > > Helmut
24 >
25 > 1) there is no "Gentoo-GIT-folder". The things in $DISTDIR/git3-src is
26 > called "bare" repositories (i.e. it is that ".git" folder itself, without
27 > "unpacked" work tree, like you have in $PORTDIR)
28 > 2) Although, all the ways to check it would be too hard for your purpose.
29 >
30 > 3) but there is nice tool for your purpose: it's called `app-portage/smart-
31 > live-rebuild`.
32 > So, just emerge it, and then just run `emerge @smart-live-rebuild` (it
33 > provides special virtual set) periodically. It will perform all the checks
34 > for you.
35
36 You wrote everything I was going to, and also something I didn't know :) . I always thought
37 you had to invoke smart-live-rebuild as its own command and never realised that it also
38 provided a special set. Cool!
39
40 I'll just add to your second point that while you can operate within a bare repository (and
41 some commands work directly, e.g., "git gc"), they are usually what you push to and fetch
42 from (meaning that you don't need a special server to host a git repo, you can just put a bare
43 repository on, e.g., a shared folder and use that as your origin).
44
45 Greetings
46 --
47 Marc Joliet
48 --
49 "People who think they know everything really annoy those of us who know we
50 don't" - Bjarne Stroustrup

Attachments

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