git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Derrick Stolee <stolee@gmail.com>, Taylor Blau <me@ttaylorr.com>,
	git@vger.kernel.org, dstolee@microsoft.com, peff@peff.net,
	szeder.dev@gmail.com
Subject: Re: Making split commit graphs pick up new options (namely --changed-paths)
Date: Wed, 16 Jun 2021 10:45:03 +0900	[thread overview]
Message-ID: <xmqqsg1itwf4.fsf@gitster.g> (raw)
In-Reply-To: <87fsxjyz01.fsf@evledraar.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Tue, 15 Jun 2021 16:35:47 +0200")

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> ... indeed unlinking a file you just created (but hold a FD
> to) is a common pattern for getting a temporary file that you don't need
> to unlink on atexit(). It's just not used in e.g. Git's codebase because
> of portability concerns.

Do we open one r/w, write into it and later read back from it,
without wanting the file to persist after we exit?  That is more
suitable for say Editor's "swp" file but I do not think of an
instance of our use of temporary file that would benefit from that
pattern.  IOW, it's not used in our codebase because we have no need
for the pattern, not due to portability concerns.

But that distinction is not the primary point in this topic.

> So not a big deal at all, but I wonder if there should be a warning
> there on !Windows, if you can't unlink a file on a POSIX system that
> suggests e.g. a persistent permission problem that won't be going away
> if you ignore it.

I do think we should catch failure from unlink and probably should
error out, unless we anticipate that somebody else might be removing
the same file and we got ENOENT.

      reply	other threads:[~2021-06-16  1:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 10:40 Making split commit graphs pick up new options (namely --changed-paths) Ævar Arnfjörð Bjarmason
2021-06-10 17:22 ` Taylor Blau
2021-06-10 18:21   ` Derrick Stolee
2021-06-10 23:56   ` Ævar Arnfjörð Bjarmason
2021-06-11  0:50     ` Taylor Blau
2021-06-11 17:47       ` Derrick Stolee
2021-06-11 19:01         ` Taylor Blau
2021-06-15 14:21           ` Derrick Stolee
2021-06-15 14:35             ` Ævar Arnfjörð Bjarmason
2021-06-16  1:45               ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqsg1itwf4.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    --cc=stolee@gmail.com \
    --cc=szeder.dev@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).