{"thread":{"id":"53756","subject":"git doing large refetches","startedAt":"2020-06-25T17:46:12Z","lastAt":"2020-06-25T17:54:23Z","messageCount":2,"participants":["Hin-Tak Leung","Pratyush Yadav"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"400617","messageId":"1731755010.6694064.1593107165458@mail.yahoo.com","threadId":"53756","inReplyTo":"1731755010.6694064.1593107165458.ref@mail.yahoo.com","subject":"git doing large refetches","fromName":"Hin-Tak Leung","fromEmail":"htl10@users.sourceforge.net","sentAt":"2020-06-25T17:46:05Z","receivedAt":"2020-06-25T17:46:12Z","isPatch":false,"sender":{"key":"htl10@users.sourceforge.net","avatar":null},"body":"Hi,\n\nLately I noticed that git occasionally do very large re-fetches, despite the difference between local and remote being not large. For example, here are two aborted fetches (see how small the emumerating / counting /compressing are, compared to the receiving object number):\n\n$ git fetch torvalds\nremote: Enumerating objects: 19374, done.\nremote: Counting objects: 100% (19374/19374), done.\nremote: Compressing objects: 100% (4016/4016), done.\n^Cceiving objects:   2% (161673/7478285), 80.54 MiB | 2.78 MiB/s\n\n$ git fetch sound\nremote: Enumerating objects: 52009, done.\nremote: Counting objects: 100% (52009/52009), done.\nremote: Compressing objects: 100% (5480/5480), done.\n^Cceiving objects:   1% (74819/7481898), 37.92 MiB | 1.98 MiB/s\n\nI don't see any real pattern, as the last few times I fetch from either of those two are also quite small ( a few days ago).\n\n$ git --version\ngit version 2.26.2\n\nstanzas from my .git/config\n\n[remote \"torvalds\"]\n\turl = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n\tfetch = +refs/heads/*:refs/remotes/torvalds/*\n[remote \"sound\"]\n\turl = git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git\n\tfetch = +refs/heads/*:refs/remotes/sound/*\n\nAnother general issue is that, I used to have just a few small files under .git/objects/XX, with a few large ones under .git/objects/pack . But at the moment, \".git/objects/pack\" is 4.4GB, while \".git/objects/\" is 5.2GB .\n\n\nAlso, is there a \"best practice\" if I like to track multiple upstreams (and the convenience of it), while keeping the local repo / heads (the part that \"I do\", and requiring back-up, etc). I thought of splitting the two into a \"mine\" repo with \"info/alternates\" pointing to a pure-fetch-reference-upstream repo; but I am a bit worried about doing a fetch on \"mine\" before or without updating the \"pure-fetch-reference-upstream\" repo, in which case I would end up with duplicate objects ending up in mine, and also, would be vulnerable to upstream doing rebase, for example. Any thoughts?\n"},{"id":"400622","messageId":"20200625175416.xnrx6dpgdg4rqvx4@yadavpratyush.com","threadId":"53756","inReplyTo":"1731755010.6694064.1593107165458@mail.yahoo.com","subject":"Re: git doing large refetches","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2020-06-25T17:54:16Z","receivedAt":"2020-06-25T17:54:23Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"Hi,\n\nOn 25/06/20 05:46PM, Hin-Tak Leung wrote:\n> Hi,\n> \n> Lately I noticed that git occasionally do very large re-fetches, despite the difference between local and remote being not large. For example, here are two aborted fetches (see how small the emumerating / counting /compressing are, compared to the receiving object number):\n> \n> $ git fetch torvalds\n> remote: Enumerating objects: 19374, done.\n> remote: Counting objects: 100% (19374/19374), done.\n> remote: Compressing objects: 100% (4016/4016), done.\n> ^Cceiving objects:   2% (161673/7478285), 80.54 MiB | 2.78 MiB/s\n> \n> $ git fetch sound\n> remote: Enumerating objects: 52009, done.\n> remote: Counting objects: 100% (52009/52009), done.\n> remote: Compressing objects: 100% (5480/5480), done.\n> ^Cceiving objects:   1% (74819/7481898), 37.92 MiB | 1.98 MiB/s\n> \n> I don't see any real pattern, as the last few times I fetch from either of those two are also quite small ( a few days ago).\n> \n> $ git --version\n> git version 2.26.2\n\nSee https://lore.kernel.org/git/20200422155047.GB91734@google.com/\n\nThis problem shouldn't be present in v2.27.*\n\n-- \nRegards,\nPratyush Yadav\n"}]}