Gentoo Archives: gentoo-user

From: Helmut Jarausch <jarausch@××××××.be>
To: gentoo-user@l.g.o
Cc: "Vadim A. Misbakh-Soloviov" <gentoo@×××.name>
Subject: Re: [gentoo-user] Status of a GIT repository
Date: Wed, 20 Dec 2017 11:24:09
Message-Id: CSCDHSRN.ZJ5JC7I3.OAWPMYAH@ZA4Y45AE.OSCXCYYO.ULFEUKGJ
In Reply to: Re: [gentoo-user] Status of a GIT repository by "Vadim A. Misbakh-Soloviov"
1 On 12/20/2017 11:28:31 AM, Vadim A. Misbakh-Soloviov wrote:
2 > В письме от среда, 20 декабря 2017 г. 17:04:33 +07 пользователь Helmut
3 > Jarausch написал:
4 > > Hi,
5 > > I have no experience with GIT.
6 > >
7 > > I'd like to determine if a GIT repository in Gentoo is up-to-date.
8 > > Normally, a GIT folder has a '.git' subfolder. Using 'git status' in
9 > > such a GIT folder works fine.
10 > >
11 > > But the subfolders in /usr/portage/distfiles/git3-src don't contain
12 > a
13 > > '.git' subfolder.
14 > > A plain 'git status' in such a subfolder doesn't work - I get
15 > "fatal:
16 > > This operation must be run in a work tree".
17 > >
18 > > Is there a means to determine the status of a Gentoo-GIT-folder?
19 > >
20 > > Background: I'd like to check if anything has changed in the GIT
21 > > repository before I run an 'emerge -u' for that.
22 > >
23 > > Many thanks for a hint,
24 > > Helmut
25 >
26 > 1) there is no "Gentoo-GIT-folder". The things in $DISTDIR/git3-src
27 > is called
28 > "bare" repositories (i.e. it is that ".git" folder itself, without
29 > "unpacked"
30 > work tree, like you have in $PORTDIR)
31 > 2) Although, all the ways to check it would be too hard for your
32 > purpose.
33 > 3) but there is nice tool for your purpose: it's called
34 > `app-portage/smart-
35 > live-rebuild`.
36 > So, just emerge it, and then just run `emerge @smart-live-rebuild` (it
37 > provides special virtual set) periodically. It will perform all the
38 > checks for
39 > you.
40
41 Many thanks! This looks like it saves me a lot of work ( I was willing
42 to write a Python script myself).
43 Helmut