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

RE: recovering from "unordered stage entries in index" error

From
McHenry, Matt <mmchenry@carnegielearning.com>
Date
May 21, 2015, 13:19 UTC
Message-ID
<D377A9280DB18546A2471214D5CBB0E908599F7E02@exchdb01>
In-Reply-To
<CACsJy8AS-9Cv6V=OKTckpnqd6OGsmvRy17TLoikT4QkA0sRofg@mail.gmail.com>
> This message can be improved to show what entries have this problem.
	Yes, that would definitely be a start.  :)
> But then I don't see any way to recover the index manually. ls-files
> will die too. Perhaps we should be gentle in this case: show warnings
	Actually, ls-files succeeds on my broken index:

$ git ls-files > /dev/null $ echo $? 0

	Could I do something with 'git read-tree' to force creation of a new valid index?  I guess 'git clone' would work too, except that I have 'git svn' metadata that I'd need to preserve.
Show 41 quoted lines
> instead of aborting the program and internally reorder the index. I
> think, unless you have multiple entries with the same stage, the
> recovered index should run well. The broken index could be renamed to
> index.broken or something for later analysis, or we forbid writing the
> reordered index to disk.
> 
> Hmm?
> 
> > write-tree: command returned error: 128
> >
> >         'git status' shows a few untracked files but is otherwise clean.
> >
> >         It looks like this check was introduced in
> 15999d0be8179fb7a2e6eafb931d25ed65df50aa, with the summary
> "read_index_from(): catch out of order entries when reading an index file"
> (first appearing in 2.2.0).
> >
> >         Mailing list discussion looked like it implicated third-party
> tools.  I don't recall running any other tools on this repo; it doesn't do
> much day-to-day other than a long series of 'git svn fetch'es.  (But it's
> been around for a couple of years, so who knows.)
> >
> >         At any rate, what can I do to recover from this situation?  I
> tried to locate a path with multiple index entries like this, but got no
> results:
> >
> > $ git ls-files -s | cut -f 2-100 | sort | uniq -c | grep -v '^[ \t]*1 '
> >
> >         (I originally posted on SO at
> http://stackoverflow.com/questions/30264826/; I'll update that with any
> solutions that come up here, to ease future googling.)
> > --
> > To unsubscribe from this list: send the line "unsubscribe git" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
> 
> --
> Duy
Previous: Duy NguyenNext: Junio C Hamano
Message 5 of 17 in “recovering from "unordered stage entries in index" error”
  1. McHenry, MattMay 19, 2015
  2. Junio C HamanoMay 19, 2015
  3. McHenry, MattMay 19, 2015
  4. Duy NguyenMay 21, 2015
  5. McHenry, MattMay 21, 2015
  6. Junio C HamanoMay 21, 2015
  7. Duy NguyenMay 22, 2015
  8. McHenry, MattMay 22, 2015
  9. Duy NguyenMay 23, 2015
  10. McHenry, MattMay 23, 2015
  11. Duy NguyenMay 24, 2015
  12. McHenry, MattMay 26, 2015
  13. Duy NguyenMay 26, 2015
  14. Junio C HamanoMay 22, 2015
  15. McHenry, MattMay 22, 2015
  16. Junio C HamanoMay 23, 2015
  17. McHenry, MattMay 23, 2015

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.