Gentoo Archives: gentoo-dev

From: Florian Schmaus <flow@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Current portage will now truncate your repo's git history to 1
Date: Sun, 18 Dec 2022 10:19:23
Message-Id: 6b15d8cb-01cc-509d-6351-0db036d3836c@gentoo.org
In Reply to: Re: [gentoo-dev] Current portage will now truncate your repo's git history to 1 by Sam James
1 On 17.12.22 06:42, Sam James wrote:
2 >> On 15 Dec 2022, at 19:22, Florian Schmaus <flow@g.o> wrote:
3 >> I personally would prefer portage simply adjusting its behavior based on the owner of the repository. That is, if it's the 'portage' user then assume full control, and if it is a different user, then fall back to a preserving, conservative mode of operation. Unfortunately, for me, this idea was received skeptically at best in a recent discussion in #gentoo-portage.
4 >
5 > This wouldn't work for Prefix and also FEATURES="-usersync".
6
7 Simply do not apply the approach on Prefix. That should be fine. I am
8 not sure how usersync being disabled (or enabled) plays a role here, though.
9
10 I believe something like this would make everyone happy:
11
12 if volatile_explicitly_configured:
13 volatile = explicitly_configured_volatile_value
14 else if prefix
15 volatile = false
16 else if Path(repo_dir).user != (root|portage) # Or, if uid >= 1000
17 volatile = true
18 else
19 volatile = false
20
21 Assuming that the "if target repo is not shallow, then no shallow clone
22 (unless explicitly requested)" check is only applied if volatile=true,
23 then you even have the desired effect that users get their repo
24 automatically converted to shallow ones. Which makes you happy. And the
25 above logic would make me happy, since the "if Path(repo_dir).uid >=
26 1000" branch would be taken for me.
27
28 That sounds like a win/win to me.
29
30 - Flow

Replies