git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Making split commit graphs pick up new options (namely --changed-paths)

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 16, 2021, 01:45 UTC
Message-ID
<xmqqsg1itwf4.fsf@gitster.g>
In-Reply-To
<87fsxjyz01.fsf@evledraar.gmail.com>
Æ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.

Previous: Ævar Arnfjörð Bjarmason
Message 10 of 10 in “Making split commit graphs pick up new options (namely --changed-paths)”
  1. Ævar Arnfjörð BjarmasonJun 10, 2021
  2. Taylor BlauJun 10, 2021
  3. Derrick StoleeJun 10, 2021
  4. Ævar Arnfjörð BjarmasonJun 10, 2021
  5. Taylor BlauJun 11, 2021
  6. Derrick StoleeJun 11, 2021
  7. Taylor BlauJun 11, 2021
  8. Derrick StoleeJun 15, 2021
  9. Ævar Arnfjörð BjarmasonJun 15, 2021
  10. Junio C HamanoJun 16, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.