From: "René Scharfe" <l.s.r@web.de>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/5] tempfile: add repo_create_tempfile{,_mode}()
Date: Wed, 15 Jul 2026 13:25:22 +0200 [thread overview]
Message-ID: <a84437e9-6a7d-41b9-b638-30c81eecd672@web.de> (raw)
In-Reply-To: <aldYTuMvN-8EMvYK@pks.im>
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é
next prev parent reply other threads:[~2026-07-15 11:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 17:59 [PATCH 0/5] tempfile: stop using the_repository René Scharfe
2026-07-14 17:59 ` [PATCH 1/5] tempfile: add repo_create_tempfile{,_mode}() René Scharfe
2026-07-15 9:52 ` Patrick Steinhardt
2026-07-15 11:25 ` René Scharfe [this message]
2026-07-14 17:59 ` [PATCH 2/5] refs/packed: use repo_create_tempfile() René Scharfe
2026-07-14 17:59 ` [PATCH 3/5] lockfile: add repo_hold_lock_file_for_update{,_timeout}{,_mode}() René Scharfe
2026-07-14 17:59 ` [PATCH 4/5] tempfile: stop using the_repository René Scharfe
2026-07-15 9:52 ` Patrick Steinhardt
2026-07-14 17:59 ` [PATCH 5/5] use repo_hold_lock_file_for_update{,_mode,_timeout}() with custom repos René Scharfe
2026-07-15 9:52 ` Patrick Steinhardt
2026-07-14 20:45 ` [PATCH 0/5] tempfile: stop using the_repository Junio C Hamano
2026-07-15 9:51 ` Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a84437e9-6a7d-41b9-b638-30c81eecd672@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox