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

Re: Committing crimes with NTFS-3G

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Aug 30, 2024, 15:55 UTC
Message-ID
<ZtHrV5dOlTpCDV8z@tapette.crustytoothpaste.net>
In-Reply-To
<fe9d19fa-661d-4358-aa0a-ea419c419266@gaijin.team>
On 2024-08-30 at 19:25:56, Roman Sandu wrote:
Show 13 quoted lines
> The stat output for a random file in the root of the repository is as
> follows:
> ```
>   File: <CENSORED>
>   Size: 91876     	Blocks: 184        IO Block: 4096   regular file
> Device: 259,2	Inode: 4630629     Links: 1
> Access: (0664/-rw-rw-r--)  Uid: ( 1000/romasandu)   Gid: ( 1000/romasandu)
> Access: 2024-08-29 17:41:04.855126300 +0300
> Modify: 2024-08-29 17:41:04.855609000 +0300
> Change: 2024-08-29 17:41:04.855609000 +0300
>  Birth: -
> ```
> Maybe lack of a birth stat is what drives git crazy?
That doesn't exist in POSIX, so it isn't used in Git.

I looked at the Ubuntu git package and it doesn't use `USE_NSEC`, so your lack of nanosecond precision in timestamps probably isn't the problem here.

You may want to try using a utility like https://github.com/shogo82148/git-dump-index to dump the index and find out what might have changed. You can use `stat -c` to write the data for the actual files in the same format, and then run `diff` on the two to find out where they disagree. Or, perhaps you can just eyeball it, in case there's something obvious (like a `uid` difference).

Or, you could try instrumenting `match_stat_data` or `stat_validity_check` in `statinfo.c` and printing the data that's changed.

You might also try disabling untracked cache and see if that fixes the problem. It might be that there _is_ a bug in that the untracked cache information isn't correctly refreshed when it was originally written on a different platform. It's known that Windows writes different information into the index than Unix systems and perhaps that information doesn't get refreshed properly.

One other thought: Windows stores symlinks with a different size than most Unix systems. Windows tends to give them a full block size, whereas Unix gives them a size of their length in bytes. That definitely breaks using symlinks in a repository across Windows and WSL. I don't know if that's what's going on here, but of course it could be related.

-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
Previous: Roman SanduNext: Roman Sandu
Message 6 of 14 in “Committing crimes with NTFS-3G”
  1. Roman SanduAug 29, 2024
  2. brian m. carlsonAug 30, 2024
  3. Roman SanduAug 30, 2024
  4. brian m. carlsonAug 30, 2024
  5. Roman SanduAug 30, 2024
  6. brian m. carlsonAug 30, 2024
  7. Roman SanduAug 30, 2024
  8. Vito CaputoAug 30, 2024
  9. Johannes SixtAug 30, 2024
  10. Roman SanduAug 30, 2024
  11. Junio C HamanoAug 30, 2024
  12. Torsten BögershausenSep 3, 2024
  13. Roman SanduSep 3, 2024
  14. Torsten BögershausenSep 5, 2024

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.