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

Re: [PATCH] checkout files in-place

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 11, 2018, 18:02 UTC
Message-ID
<xmqqvaapb3r1.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180611020411.GE38834@genre.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 5 quoted lines
>> +	file prevent creating new files at the same path. Note that Git will not
>> +	update read/write permissions according to umask.
>
> I'm wondering if it's worth a mention that running out of disk space (or
> quota) will cause data to be truncated.

Aside from us not having to worry about emulating the umask, another reason why we prefer "create, complete the write, and then finally rename" over "overwrite and let it fail in the middle" is that the former makes sure we never leave the path in a bad state. It either has a complete copy of the old contents, or a complete copy of the new contents, and a third-party process reading from sidelines would not get a partial copy, regardless of disc-full issue.

Previous: Clemens BuchacherNext: Clemens Buchacher
Message 4 of 13 in “checkout files in-place”
  1. checkout files in-placeClemens Buchacher, Jun 10, 2018
  2. brian m. carlsonJun 11, 2018
  3. Clemens BuchacherJun 11, 2018
  4. Junio C HamanoJun 11, 2018
  5. Clemens BuchacherJun 11, 2018
  6. Ævar Arnfjörð BjarmasonJun 11, 2018
  7. Edward ThomsonJun 11, 2018
  8. Clemens BuchacherJun 11, 2018
  9. checkout files in-placeClemens Buchacher, Jun 11, 2018
  10. Ævar Arnfjörð BjarmasonJun 11, 2018
  11. Junio C HamanoJun 11, 2018
  12. Edward ThomsonJun 12, 2018
  13. Orgad ShanehJun 13, 2018

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.