В письме от среда, 20 декабря 2017 г. 17:04:33 +07 пользователь Helmut Jarausch написал: > Hi, > I have no experience with GIT. > > I'd like to determine if a GIT repository in Gentoo is up-to-date. > Normally, a GIT folder has a '.git' subfolder. Using 'git status' in > such a GIT folder works fine. > > But the subfolders in /usr/portage/distfiles/git3-src don't contain a > '.git' subfolder. > A plain 'git status' in such a subfolder doesn't work - I get "fatal: > This operation must be run in a work tree". > > Is there a means to determine the status of a Gentoo-GIT-folder? > > Background: I'd like to check if anything has changed in the GIT > repository before I run an 'emerge -u' for that. > > Many thanks for a hint, > Helmut
1) there is no "Gentoo-GIT-folder". The things in $DISTDIR/git3-src is called "bare" repositories (i.e. it is that ".git" folder itself, without "unpacked" work tree, like you have in $PORTDIR) 2) Although, all the ways to check it would be too hard for your purpose. 3) but there is nice tool for your purpose: it's called `app-portage/smart- live-rebuild`. So, just emerge it, and then just run `emerge @smart-live-rebuild` (it provides special virtual set) periodically. It will perform all the checks for you.