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

[GSoC14][RFC] Proposal Draft: Refactor tempfile handling

From
Brian Gesiak <modocache@gmail.com>
Date
Mar 1, 2014, 21:04 UTC
Message-ID
<CAN7MxmVQuk96dmXfxZ5kRZPTXNwpz2RY=y8HyqX4mZzrZUVbNg@mail.gmail.com>
Hello all,

My name is Brian Gesiak. I'm a research student at the University of Tokyo, and I'm hoping to participate in this year's Google Summer of Code by contributing to Git. I'm a longtime user, first-time contributor--some of you may have noticed my "microproject" patches.[1][2]

I'd like to gather some information on one of the GSoC ideas posted on the ideas page. Namely, I'm interested in refactoring the way tempfiles are cleaned up.

The ideas page points out that while lock files are closed and unlinked[3] when the program exits[4], object pack files implement their own brand of temp file creation and deletion. This implementation doesn't share the same guarantees as lock files--it is possible that the program terminates before the temp file is unlinked.[5]

Lock file references are stored in a linked list. When the program exits, this list is traversed and each file is closed and unlinked. It seems to me that this mechanism is appropriate for temp files in general, not just lock files. Thus, my proposal would be to extract this logic into a separate module--tempfile.h, perhaps. Lock and object files would share the tempfile implementation.

That is, both object and lock temp files would be stored in a linked list, and all of these would be deleted at program exit.

I'm very enthused about this project--I think it has it all:
- Tangible benefits for the end-user
- Reduced complexity in the codebase
- Ambitious enough to be interesting
- Small enough to realistically be completed in a summer

Please let me know if this seems like it would make for an interesting proposal, or if perhaps there is something I am overlooking. Any feedback at all would be appreciated. Thank you!

- Brian Gesiak

[1] http://thread.gmane.org/gmane.comp.version-control.git/242891 [2] http://thread.gmane.org/gmane.comp.version-control.git/242893 [3] https://github.com/git/git/blob/v1.9.0/lockfile.c#L18 [4] https://github.com/git/git/blob/v1.9.0/lockfile.c#L143 [5] https://github.com/git/git/blob/v1.9.0/pack-write.c#L350

Next: Jeff King
Message 1 of 7 in “[GSoC14][RFC] Proposal Draft: Refactor tempfile handling”
  1. Brian GesiakMar 1, 2014
  2. Jeff KingMar 3, 2014
  3. Brian GesiakMar 8, 2014
  4. Jeff KingMar 11, 2014
  5. Michael HaggertyMar 11, 2014
  6. Jeff KingMar 11, 2014
  7. Brian GesiakMar 12, 2014

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.