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

Re: Bug? file at the same time being deleted and not registered

From
TPTomas Pospisek <tpo@sourcepole.ch>
Date
May 24, 2010, 08:29 UTC
Message-ID
<alpine.DEB.2.00.1005241027580.8425@tpo-laptop>
In-Reply-To
<20100524082430.GA18755@coredump.intra.peff.net>
On Mon, 24 May 2010, Jeff King wrote:
Show 38 quoted lines
> On Mon, May 24, 2010 at 10:02:14AM +0200, Tomas Pospisek wrote:
>
>>> Can you try running the output of "git diff-files --name-only" and "git
>>> ls-files -o" through xxd or something that would show individual bytes?
>>> My suspicion is that the "a_file" shown in each may not be bit-for-bit
>>> identical.
>>
>>  $ git diff-files --name-only
>>  $ # no output at all
>
> Hrm, I had originally thought that your "git status" output showed
> a_file as deleted in the working tree, which is why I suggested
> diff-files. But looking at your output again, I see that it is scheduled
> for deletion. In other words, the index entry has been removed entirely,
> as if "git rm --cached a_file" had been issued.
>
> So I think I was on the wrong track with the filename-munging, then.
> Sorry to lead you astray. But the problem is that your index is missing
> or bogus, which is even weirder.
>
> Looking at your strace dump, I see it writing out the index (it writes
> to index.lock and then renames it into place). Can you take a look at
> your .git/index file? It should be 104 bytes and look something like:
>
>  $ xxd .git/index
>  0000000: 4449 5243 0000 0002 0000 0001 4bfa 367d  DIRC........K.6}
>  0000010: 0000 0000 4bfa 367d 0000 0000 0000 0900  ....K.6}........
>  0000020: 0099 801d 0000 81a4 0000 03e8 0000 03e8  ................
>  0000030: 0000 0000 e69d e29b b2d1 d643 4b8b 29ae  ...........CK.).
>  0000040: 775a d8c2 e48c 5391 0006 615f 6669 6c65  wZ....S...a_file
>  0000050: 0000 0000 1f80 d668 c07b 5955 8678 4360  .......h.{YU.xC`
>  0000060: 8215 6238 89be 9b4d
>
> It won't match byte-for-byte because there is stat information in there,
> but you should see a_file.
>
> If it's empty or 32 bytes, then that explains what status is reporting
> (but the question still remains how we got into that state).
There's no .git/index file there:
  $ ls -l .git/
  total 36
  drwxr-xr-x 2 tpo tpo 4096 2010-05-23 21:36 branches
  -rw-r--r-- 1 tpo tpo    4 2010-05-23 21:36 COMMIT_EDITMSG
  -rw-r--r-- 1 tpo tpo   73 2010-05-23 21:36 description
  -rw-r--r-- 1 tpo tpo   23 2010-05-23 21:36 HEAD
  drwxr-xr-x 2 tpo tpo 4096 2010-05-23 21:36 hooks
  drwxr-xr-x 2 tpo tpo 4096 2010-05-23 21:36 info
  drwxr-xr-x 3 tpo tpo 4096 2010-05-23 21:36 logs
  drwxr-xr-x 7 tpo tpo 4096 2010-05-24 09:26 objects
  drwxr-xr-x 4 tpo tpo 4096 2010-05-23 21:36 refs
*t
Previous: Jeff KingNext: Jeff King
Message 5 of 9 in “Bug? file at the same time being deleted and not registered”
  1. Tomas PospisekMay 23, 2010
  2. Jeff KingMay 23, 2010
  3. Tomas PospisekMay 24, 2010
  4. Jeff KingMay 24, 2010
  5. Tomas PospisekMay 24, 2010
  6. Jeff KingMay 24, 2010
  7. Tomas PospisekMay 24, 2010
  8. Tomas PospisekMay 24, 2010
  9. Tomas PospisekMay 24, 2010

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.