public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff King <peff@peff•net>
To: "René Scharfe" <l.s.r@web•de>
Cc: Git List <git@vger•kernel.org>
Subject: Re: [PATCH 2/4] compat: use git_mkdtemp()
Date: Fri, 5 Dec 2025 21:11:22 -0500	[thread overview]
Message-ID: <20251206021122.GC1714099@coredump.intra.peff.net> (raw)
In-Reply-To: <aebd0ffe-7914-4731-8f79-830bd3b5a147@web.de>

On Fri, Dec 05, 2025 at 01:11:40PM +0100, René Scharfe wrote:

> > This one is a conditionally-compiled wrapper for NO_MKDTEMP. But since
> > we always have git_mkdtemp() available (as of your first patch), can't
> > we just point at it directly with the macro?
> 
> A worthwhile cleanup if we stop at this point, but complicated by
> targeting three build systems, the CMake build being broken on macOS and
> me only knowing how to fake NO_MKDEMP for make, leaving half the build
> space untestable for me.
> [...]
> At the very least this cleanup should be done in a separated patch, as
> it's harder than it looks.

OK, I am convinced that it is not entirely trivial and can go in a
separate patch. :) Mostly I was surprised that you would not have
followed through on an obvious cleanup opportunity.  It just turned out
harder than I expected.

> Right.  Dropping this dependency and then deep cleaning the compat code
> is attractive and mostly sidesteps the build system complications.
> That's for a later series.

Yup. Sounds reasonable.

> Ultimately you'd prefer banning mkdtemp(3) instead of automatically
> redirecting to git_mkdtemp(), though, no?

I'm OK either way. Whatever we end up doing for mkstemp(), I think we
should match here.

I do like being explicit that we are using our own wrapper and not the
system function. But I wonder if it might make complications in
third-party code like clar, which calls mkdtemp(). If we don't have a
compat macro we'll have to patch the sources that we import into
t/unit-tests/clar.

So maybe that is an argument that we should leave the "#define mkdtemp"
in place.

-Peff

  reply	other threads:[~2025-12-06  2:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03 10:45 [PATCH 0/4] ban mktemp(3) René Scharfe
2025-12-03 10:51 ` [PATCH 1/4] wrapper: add git_mkdtemp() René Scharfe
2025-12-04 11:51   ` Chris Torek
2025-12-05 23:05   ` Junio C Hamano
2025-12-03 10:52 ` [PATCH 2/4] compat: use git_mkdtemp() René Scharfe
2025-12-03 16:11   ` Jeff King
2025-12-05 12:11     ` René Scharfe
2025-12-06  2:11       ` Jeff King [this message]
2025-12-05 23:05     ` Junio C Hamano
2025-12-03 10:52 ` [PATCH 3/4] compat: remove mingw_mktemp() René Scharfe
2025-12-03 10:53 ` [PATCH 4/4] banned.h: ban mktemp(3) René Scharfe
2025-12-03 16:12   ` Jeff King
2025-12-06 13:21 ` [PATCH v2 0/5] " René Scharfe
2025-12-06 13:27   ` [PATCH v2 1/5] wrapper: add git_mkdtemp() René Scharfe
2025-12-06 13:27   ` [PATCH v2 2/5] compat: use git_mkdtemp() René Scharfe
2025-12-06 13:28   ` [PATCH v2 3/5] compat: remove mingw_mktemp() René Scharfe
2025-12-06 13:29   ` [PATCH v2 4/5] banned.h: ban mktemp(3) René Scharfe
2025-12-06 13:35   ` [PATCH v2 5/5] compat: remove gitmkdtemp() René Scharfe
2025-12-08 20:33   ` [PATCH v2 0/5] ban mktemp(3) Jeff King

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=20251206021122.GC1714099@coredump.intra.peff.net \
    --to=peff@peff$(echo .)net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=l.s.r@web$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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