From: René Scharfe Date: Wed, 15 Jul 2026 11:25:22 GMT Subject: Re: [PATCH 1/5] tempfile: add repo_create_tempfile{,_mode}() Message-ID: In-Reply-To: On 7/15/26 11:52 AM, Patrick Steinhardt wrote: > On Tue, Jul 14, 2026 at 07:59:52PM +0200, René Scharfe wrote: >> Add variants of create_tempfile_mode() that handle arbitrary >> repositories. > > One thing I was wondering is whether it really makes sense to pass in a > full repository. All we require it for is `adjust_shared_perm()`, and it > feels quite extreme to require a full-blown repository. > > An alternative would be to let callers pass in the setting by > themselves, but that would likely lead to lots of duplicated code. So > maybe this is a good first step, and we could eventually create another > API where users can pass in the configuration instead of a repository if > we ever gain callers that don't have a repository available. Had the same thought. I think it's because create_tempfile() sounds quite generic, but is actually for creating temporary files within a repository, not just anywhere or just for the duration of the creating process, so shared access matters (if enabled). I didn't find a case where a caller would not have at least the_repository to pass in, so while a repo-less adjust_shared_perm() or create_tempfile() might seem cleaner, we probably won't need it in practice. We'll find out.. René