Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936255 - Add commit to emerge.log when merging git version.
Summary: Add commit to emerge.log when merging git version.
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-18 15:19 UTC by lekto
Modified: 2024-07-18 21:32 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lekto 2024-07-18 15:19:59 UTC
Right now, Portage doesn't store commit number when installing packages in the git version, and there is no simple and 100% accurate way to get the commit [1]. Portage stores only package version (nines), which is pretty much useless:
> 1682775580:  >>> emerge (38 of 64) net-p2p/transgui-9999 to /
> 1682775580:  === (38 of 64) Cleaning (net-p2p/transgui-9999::/var/db/repos/lekto/net-p2p/transgui/transgui-9999.ebuild)
> 1682775580:  === (38 of 64) Compiling/Merging (net-p2p/transgui-9999::/var/db/repos/lekto/net-p2p/transgui/transgui-9999.ebuild)
> 1682775603:  === (38 of 64) Merging (net-p2p/transgui-9999::/var/db/repos/lekto/net-p2p/transgui/transgui-9999.ebuild)
> 1682775605:  >>> AUTOCLEAN: net-p2p/transgui:0
> 1682775605:  === Unmerging... (net-p2p/transgui-9999)
> 1682775606:  >>> unmerge success: net-p2p/transgui-9999
> 1682775607:  === (38 of 64) Post-Build Cleaning (net-p2p/transgui-9999::/var/db/repos/lekto/net-p2p/transgui/transgui-9999.ebuild)
> 1682775607:  ::: completed emerge (38 of 64) net-p2p/transgui-9999 to /

Enhancement: keep git commit in emerge.log.

[1] https://forums.gentoo.org/viewtopic-p-8834024.html#8834024
Comment 1 Mike Gilbert gentoo-dev 2024-07-18 17:55:04 UTC
Given the way this is implemented via eclass, I don't think adding the commit hash to emerge.log is possible or even makes sense.

You can find the commit hash in the environment file under /var/db/pkg.
Comment 2 lekto 2024-07-18 18:39:54 UTC
The problem is when the package was working, but after the update, it stopped. Or when I checked last time x updates, x month ago it was working but now it won't.

If it shouldn’t be stored in emerge.log, maybe it makes more sense to store it in /var/cache/distfiles/git3-src? It could be something simple, like a text file containing information about when and what was updated to which commit.
Comment 3 Zac Medico gentoo-dev 2024-07-18 18:48:21 UTC
I wonder what mechanism smart-live-rebuild uses. Ideally we'd have a standard mechanism defined in PMS which is what bug 482666 is about.
Comment 4 Enne Eziarc 2024-07-18 21:32:13 UTC
(In reply to Zac Medico from comment #3)
> I wonder what mechanism smart-live-rebuild uses. Ideally we'd have a
> standard mechanism defined in PMS which is what bug 482666 is about.

smart-live-rebuild checks whether EGIT_COMMIT in /var/db/pkg matches the output of git-ls-remote(1), i.e. it does network lookups at dependency calculation time. It seems to have similar ad-hoc mechanisms for other VCS types.


It's possible to record the update history of a local git repo in the reflog, but it needs to be explicitly opted-into in bare repositories (config core.logAllRefUpdates). It adds a few tens of KiB to a repo's size and would've helped in this case, so I'd like to propose having git-r3.eclass flip that setting on unless there's a good reason not to.