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

Re: Committing crimes with NTFS-3G

From
RSRoman Sandu <r.sandu@gaijin.team>
Date
Aug 30, 2024, 12:52 UTC
Message-ID
<3eda2715-3b44-469e-85d5-f25504212928@gaijin.team>
In-Reply-To
<ZtEWvQOwLPgjIFks@tapette.crustytoothpaste.net>

Yes, I am aware that the index will be fully refreshed on the first run of status. That is completely acceptable. But that is not what I am observing, it is being refreshed on every single run of `git status`!

After running stat before and after a status, the sha256 is identical. Both for files and for folders. Maybe Windows has somehow corrupted the index with its negative aura which makes git invalidate it on every single run? Are there tools in git to diagnose the reason for the index's cache being invalidated?

On the topic of Unix permissions -- as far as I can tell, they ARE in fact working, because I've created a UserMapping file that tells NTFS-3G how to map between NTFS/Windows user UUIDs and Linux user IDs. See NTFS-3G's github page (https://github.com/tuxera/ntfs-3g).

On 8/30/24 03:47, brian m. carlson wrote:
Show 40 quoted lines
> On 2024-08-29 at 20:43:40, Roman Sandu wrote:
>> Good day!
>>
>> I have a decently sized (80K files) monorepo on an NTFS drive that I have
>> been working with for a while under Windows via git-for-windows. Recently, I
>> had to (temporarily) switch to Ubuntu (24.04) via dual-boot for irrelevant
>> reasons, and I decided that simply mounting my NTFS drive and using the
>> monorepo from Ubuntu is a great idea, actually, as NTFS-3G allow for
>> seamless interop with NTFS via UserMapping. And so that is exactly what I
>> did and It Just Works!
> 
> In general, I would not recommend this.  NTFS doesn't support Unix
> permissions, so I'd expect a lot of things to be broken.  A lot of
> people like using NTFS to share data across Windows and Linux, but UDF
> is a much better choice and I'm not surprised that NTFS isn't working
> the way you'd expect.
> 
> Also, when you share a repository across systems, you should expect the
> index to be fully refreshed each time you change the OS, reading every
> file in the repository[0].
> 
>> So, what do I do about this? It honestly looks like a git bug to me, maybe
>> it silently fails to update the index with new timestamps because it was
>> initially created on Windows? But I have no clue how to narrow this issue
>> down further, so any ideas or suggestions would be appreciated!
> 
> Can you pick some file in your repository and run `stat` on it, before
> and after running `git status`, and include the output?
> 
> For example:
> 
>    stat http.c | tee /tmp/before
>    git status
>    stat http.c | tee /tmp/after
>    sha256sum /tmp/before /tmp/after
> 
> My guess is that NTFS-3G is not emulating something properly and it's
> differing at some point.
> 
> [0] https://git-scm.com/docs/gitfaq#sync-working-tree
Previous: brian m. carlsonNext: brian m. carlson
Message 3 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.