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

[PATCH 0/2] commit-graph/server-info: use tempfile.h in more places

From
Taylor Blau <me@ttaylorr.com>
Date
Jun 6, 2024, 22:19 UTC
Message-ID
<cover.1717712358.git.me@ttaylorr.com>

This pair of patches addresses two issues (in the commit-graph and update-server-info areas, respectively), where temporary files are created outside of the tempfile.h API and thus survive abnormal process death.

The commit-graph one is more prevalent, and has been the cause of some minor headaches (for e.g. automated tooling to detect repository cruft at GitHub complaining about unknown tmp_graph_XXXXXX files left around).

The fixes in both instances are relatively straightforward conversions to use the tempfile.h API.

Looking at the remaining uses of mkstemp(), the remaining class of callers that don't use the tempfile.h API are for creating temporary .idx, .rev files, and similar. My personal feeling is that we should apply similar treatment there, since these files are generated based on .pack data, and thus keeping around temporary copies is unnecessary when they can be regenerated.

But I'd rather keep that part out of this series and clean up a couple of more straightforward spots where possible.

Thanks in advance for your review!
Taylor Blau (2):
  commit-graph.c: remove temporary graph layers on exit
  server-info.c: remove temporary info files on exit
 commit-graph.c                | 19 ++++++++-----------
 server-info.c                 | 26 ++++++++++----------------
 t/t5324-split-commit-graph.sh | 26 +++++++++++++++++++++++++-
 3 files changed, 43 insertions(+), 28 deletions(-)
base-commit: 7b0defb3915eaa0bd118f0996e8c00b4eb2dc1ca
-- 
2.45.2.411.g2d5a0536af1
Next: Taylor Blau
Message 1 of 17 in “commit-graph/server-info: use tempfile.h in more places”
  1. 0/2 commit-graph/server-info: use tempfile.h in more placesTaylor Blau, Jun 6, 2024
  2. 1/2 commit-graph.c: remove temporary graph layers on exitTaylor Blau, Jun 6, 2024
  3. Junio C HamanoJun 7, 2024
  4. Taylor BlauJun 7, 2024
  5. Junio C HamanoJun 7, 2024
  6. Jeff KingJun 8, 2024
  7. Junio C HamanoJun 7, 2024
  8. Jeff KingJun 8, 2024
  9. 2/2 server-info.c: remove temporary info files on exitTaylor Blau, Jun 6, 2024
  10. Junio C HamanoJun 7, 2024
  11. Taylor BlauJun 7, 2024
  12. Junio C HamanoJun 7, 2024
  13. Jeff KingJun 8, 2024
  14. Junio C HamanoJun 7, 2024
  15. Jeff KingJun 8, 2024
  16. Elijah NewrenJun 14, 2024
  17. Taylor BlauJun 14, 2024

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.