{"thread":{"id":"59178","subject":"[Help][Bug] Git pull fails while pulling large commits on FUSE based filesystem","startedAt":"2023-02-01T22:56:53Z","lastAt":"2023-02-01T22:56:53Z","messageCount":1,"participants":["Palaniappan Nagarajan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"471276","messageId":"CAPsey7=9y=j3s1gmO5sFbZXfD_X9osEJ8i-x=SdRM0e27Pbtpg@mail.gmail.com","threadId":"59178","inReplyTo":null,"subject":"[Help][Bug] Git pull fails while pulling large commits on FUSE based filesystem","fromName":"Palaniappan Nagarajan","fromEmail":"palaniappan.feb22@gmail.com","sentAt":"2023-02-01T22:56:37Z","receivedAt":"2023-02-01T22:56:53Z","isPatch":false,"sender":{"key":"palaniappan.feb22@gmail.com","avatar":null},"body":"Hi Community,\nWe have a peculiar environment: We use git repository on a directory\nmounted using s3-fuse(https://github.com/s3fs-fuse/s3fs-fuse). The\ndirectory is backed up to the Amazon S3 bucket. Whenever we try to run\n`git pull` that could pull in *large commits*, we are facing the\nfollowing error.\n\n$ git pull origin main\nremote: Enumerating objects: 102, done.\nremote: Counting objects: 100% (102/102), done.\nremote: Compressing objects: 100% (101/101), done.\nremote: Total 102 (delta 1), reused 102 (delta 1), pack-reused 0\nReceiving objects: 100% (102/102), 72.24 MiB | 15.48 MiB/s, done.\nResolving deltas: 100% (1/1), completed with 1 local object.\nfatal: Failed to checksum '.git/objects/pack/tmp_pack_VvTvzo': No such\nfile or directory\nfatal: fetch-pack: invalid index-pack output\n\nI can confirm that the file '.git/objects/pack/tmp_pack_XXXXX' is\npresent once the command completes. In the S3 fuse logs, I see that\nthe file is read before the file is created.\n\nThe issue happens only during `git pull` and `git clone` with the\nlarge commits works without any issues.\n\nCan anyone help with any pointers/ workaround/ potential solution to\nfix this issue? Is there a way to override the location of temporary\nfiles \"tmp_pack_XXXXX\" files so that it can be created outside the\nmount directory? Setting the object directory outside the mount\ndirectory using GIT_OBJECT_DIRECTORY is not an option as we want to\nbackup git history.\n\nP.S. My experiment that could throw some light on the issue.\n1. Created a Git repository with 1000 files of 1 MB.\n(https://github.com/cyn0/2kfiles-large)\n2. Git clone on the mounted directory works without any issue.\n3. Added 5 files of each 1MB size to the repository.\n(https://github.com/cyn0/2kfiles-large/commit/42aa5d83e9035460ffa9c3b2f4494c0828f6b1c7)\n4. From the mounted directory, \"git pull origin main\" works without any size.\n5. Now, add 100 files of each 1MB to the repository.\n(https://github.com/cyn0/2kfiles-large/commit/7304886116d9bdec8a8c2da020776995a6624bd2)\n6. From the mounted directory, \"git pull origin main\" fails with the\nabove error.\n\nThanks in advance for your help!\n\nRegards,\nPalaniappan\n"}]}