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

[BUG] index corruption with git commit -p

From
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Date
Sep 1, 2018, 21:41 UTC
Message-ID
<20180901214157.hxlqmbz3fds7hsdl@ltop.local>
Hi,
I've just had a scary error:
	error: index uses $?+? extension, which we do not understand
	fatal: index file corrupt

Things were quickly recovered by deleting the index but it clearly looks to a but to me.

Here are the steps to reproduce it:
  $ git clone git://github.com/lucvoo/sparse-dev.git <somedir>
  $ cd <somedir>
  $ git co index-corruption
  $ git rm -r validation/ Documentation/
  $ git commit -m <some message> -p
  $ git status
error: index uses $?+? extension, which we do not understand
fatal: index file corrupt

The 'extension' pattern '$?+?', can vary a bit, sometimes it's just '????', but always seems 4 chars. If the commit command doesn't use the '-p' flag, there is no problem. The repository itself is not corrupted, it's only the index. It happends with git 2.18.0 and 2.17.0

-- Luc Van Oostenryck
Next: Ævar Arnfjörð Bjarmason
Message 1 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.