{"thread":{"id":"52587","subject":"Git bundle create produces inconsistent bundle","startedAt":"2020-01-07T17:53:09Z","lastAt":"2020-01-07T18:03:48Z","messageCount":2,"participants":["Andre Loconte","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"389401","messageId":"QBxpUR_NauPk0G8X2KKsqzlrfyxNuA4OoNR3Dm1KpHMNEELiSUxKr_IDM_qghObDt4aVv-bjg1ZQtCYRgxArdGsK52wCuO1LbsqzlHBto-k=@protonmail.com","threadId":"52587","inReplyTo":null,"subject":"Git bundle create produces inconsistent bundle","fromName":"Andre Loconte","fromEmail":"andre.loconte@protonmail.com","sentAt":"2020-01-07T17:44:47Z","receivedAt":"2020-01-07T17:53:09Z","isPatch":false,"sender":{"key":"andre.loconte@protonmail.com","avatar":null},"body":"Hello,\n\nI am running into an issue where \"git bundle create\" doesn't always produce the same bundle, provided the exact same arguments and the exact same repo.\n\nWhere it gets tricky is that:\n\n- I cannot reproduce the issue with random repos from Github (tried with ~10 repos and 30 bundles per repo);\n- I cannot reproduce the issue with the same OS and git version on different hardware ;\n- I can reproduce the issue on colleagues' workstation (environment is identical down to the hardware, see below).\n\nEnvironment:\n\n- GNU/Linux 5.3.0-24-generic Ubuntu 19.10 x86_64 ;\n- git version 2.20.1 ;\n- Intel Xeon Silver 4114 CPU @ 2.20GHz × 20 ;\n- 4 × Hynix HMA81GR7CJR8N-VK 8GB DDR4-2666 ECC.\n\nI have put together a bash PoC [1]. And there are some example output in the comments (consistent [2], inconsistent [3]).\n\n[1] https://gist.github.com/alct/05cc9a2b4657d51669c96cb22cd5c4a6\n[2] https://gist.github.com/alct/05cc9a2b4657d51669c96cb22cd5c4a6#gistcomment-3130206\n[3] https://gist.github.com/alct/05cc9a2b4657d51669c96cb22cd5c4a6#gistcomment-3130213\n\nI cannot share the affected repos but I can run any diagnostic tool against them.\n\nWould you have any clue on what could produce such behavior?\n\nBest,\n\nA.L.\n\n\n\n\n"},{"id":"389403","messageId":"20200107180346.GA48806@coredump.intra.peff.net","threadId":"52587","inReplyTo":"QBxpUR_NauPk0G8X2KKsqzlrfyxNuA4OoNR3Dm1KpHMNEELiSUxKr_IDM_qghObDt4aVv-bjg1ZQtCYRgxArdGsK52wCuO1LbsqzlHBto-k=@protonmail.com","subject":"Re: Git bundle create produces inconsistent bundle","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-01-07T18:03:46Z","receivedAt":"2020-01-07T18:03:48Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jan 07, 2020 at 05:44:47PM +0000, Andre Loconte wrote:\n\n> I am running into an issue where \"git bundle create\" doesn't always\n> produce the same bundle, provided the exact same arguments and the\n> exact same repo.\n\nThis is expected.  A bundle contains a packfile, and the packfile\ngeneration is sensitive to several things:\n\n  - the delta search is threaded (to the same number of threads as you\n    have CPUs). Try \"git -c pack.threads=1 bundle create ...\".\n\n  - we try to reuse on-disk deltas when possible. So the exact set of\n    packs you have (or which objects are loose) may impact the result\n    slightly. So between two different clones of the same repository,\n    I'd expect different results.\n\nPossibly repacking first with \"git -c pack.threads=1 repack -adf\" might\nget you an identical on-disk state in two different clones (assuming you\nhave the same refs and reflogs in each!).\n\nBut as you can see, we don't in general expect packfiles to be\nbyte-stable (this is also the reason that git clones aren't easily\nresumable).\n\n-Peff\n"}]}