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

Re: [PATCH] reopen_tempfile(): truncate opened file

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 5, 2018, 16:54 UTC
Message-ID
<xmqqva7j51gt.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180905154827.GC24660@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
>> > So AFAIK this fsck catches everything and yields a non-zero exit in the
>> > error case. And it should work for even a single byte of rubbish.
>> 
>> Yes you're right. I forgot about the trailing hash.
>
> Thanks, I was worried that I was missing something. ;)
>
> Maybe it is worth making that final comment:
>
>   # and that the trailing hash in the index was not corrupted,
>   # which should catch even a single byte of cruft
>   git fsck

Perhaps. I do not mind seeing an additional comment to explain why this requires PERL (it wasn't immediately obvious as I never use 'commit -p' myself), either.

Previous: Jeff KingNext: Jeff King
Message 16 of 19 in “[BUG] index corruption with git commit -p”
  1. Luc Van OostenryckSep 1, 2018
  2. Ævar Arnfjörð BjarmasonSep 1, 2018
  3. Jeff KingSep 2, 2018
  4. Duy NguyenSep 2, 2018
  5. Jeff KingSep 2, 2018
  6. Luc Van OostenryckSep 2, 2018
  7. Jeff KingSep 2, 2018
  8. Junio C HamanoSep 4, 2018
  9. Duy NguyenSep 4, 2018
  10. Jeff KingSep 4, 2018
  11. reopen_tempfile(): truncate opened fileJeff King, Sep 4, 2018
  12. Duy NguyenSep 5, 2018
  13. Jeff KingSep 5, 2018
  14. Duy NguyenSep 5, 2018
  15. Jeff KingSep 5, 2018
  16. Junio C HamanoSep 5, 2018
  17. Jeff KingSep 5, 2018
  18. Junio C HamanoSep 5, 2018
  19. Luc Van OostenryckSep 5, 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.