{"thread":{"id":"15981","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","startedAt":"2008-10-20T18:12:04Z","lastAt":"2008-10-20T20:12:51Z","messageCount":10,"participants":["Marco Roeland","Harvey Harrison","Nicolas Pitre","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"93539","messageId":"alpine.LFD.2.00.0810201357340.26244@xanadu.home","threadId":"15981","inReplyTo":null,"subject":"[PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2008-10-20T18:12:04Z","receivedAt":"2008-10-20T18:12:04Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"My bad.  A small detail went through the crack: the real_type of\na delta object is the real_type of its base object.\n\nWithout this, the created index will be wrong as the actual object SHA1\nwon't match the object.\n\nSigned-off-by: Nicolas Pitre <nico@cam.org>\n---\n\nIf you got a corrupted .idx file because of this ('git verify-pack' \nshould tell) then just toss it and recreate with a fixed 'git \nindex-pack'.\n\nCould anyone having problems fetching from kernel.org with git from the \nnext branch confirm that this also fixes that? Thanks.\n\ndiff --git a/index-pack.c b/index-pack.c\nindex 0a917d7..8287ebf 100644\n--- a/index-pack.c\n+++ b/index-pack.c\n@@ -517,7 +517,7 @@ static void resolve_delta(struct object_entry *delta_obj,\n \tvoid *delta_data;\n \tunsigned long delta_size;\n \n-\tdelta_obj->real_type = base->obj->type;\n+\tdelta_obj->real_type = base->obj->real_type;\n \tdelta_data = get_data_from_pack(delta_obj);\n \tdelta_size = delta_obj->size;\n \tresult->obj = delta_obj;\n"},{"id":"93545","messageId":"590657100810201137m477b834cr9c940851b1a599d8@mail.gmail.com","threadId":"15981","inReplyTo":"alpine.LFD.2.00.0810201357340.26244@xanadu.home","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Harvey Harrison","fromEmail":"harvey.harrison@gmail.com","sentAt":"2008-10-20T18:37:39Z","receivedAt":"2008-10-20T18:37:39Z","isPatch":true,"sender":{"key":"harvey.harrison@gmail.com","avatar":null},"body":"On Mon, Oct 20, 2008 at 11:12 AM, Nicolas Pitre <nico@cam.org> wrote:\n> My bad.  A small detail went through the crack: the real_type of\n> a delta object is the real_type of its base object.\n>\n> Without this, the created index will be wrong as the actual object SHA1\n> won't match the object.\n>\n> Signed-off-by: Nicolas Pitre <nico@cam.org>\n\nThis fixes it for me, thanks for the quick fix.\n\nTested-by: Harvey Harrison <harvey.harrison@gmail.com>\n"},{"id":"93535","messageId":"590657100810201207s9a5f4f5j8572f570928e97c8@mail.gmail.com","threadId":"15981","inReplyTo":"590657100810201137m477b834cr9c940851b1a599d8@mail.gmail.com","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Harvey Harrison","fromEmail":"harvey.harrison@gmail.com","sentAt":"2008-10-20T19:07:54Z","receivedAt":"2008-10-20T19:07:54Z","isPatch":true,"sender":{"key":"harvey.harrison@gmail.com","avatar":null},"body":"On Mon, Oct 20, 2008 at 11:37 AM, Harvey Harrison\n<harvey.harrison@gmail.com> wrote:\n> On Mon, Oct 20, 2008 at 11:12 AM, Nicolas Pitre <nico@cam.org> wrote:\n>> My bad.  A small detail went through the crack: the real_type of\n>> a delta object is the real_type of its base object.\n>>\n>> Without this, the created index will be wrong as the actual object SHA1\n>> won't match the object.\n>>\n>> Signed-off-by: Nicolas Pitre <nico@cam.org>\n>\n> This fixes it for me, thanks for the quick fix.\n>\n> Tested-by: Harvey Harrison <harvey.harrison@gmail.com>\n>\n\nScratch that, it's back to failing again on my next update.\n\nHarvey\n"},{"id":"93550","messageId":"20081020191400.GA18743@fiberbit.xs4all.nl","threadId":"15981","inReplyTo":"alpine.LFD.2.00.0810201357340.26244@xanadu.home","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Marco Roeland","fromEmail":"marco.roeland@xs4all.nl","sentAt":"2008-10-20T19:14:00Z","receivedAt":"2008-10-20T19:14:00Z","isPatch":true,"sender":{"key":"marco.roeland@xs4all.nl","avatar":null},"body":"On Monday October 2008 at 14:12 Nicolas Pitre wrote:\n\n> My bad.  A small detail went through the crack: the real_type of\n> a delta object is the real_type of its base object.\n> \n> Without this, the created index will be wrong as the actual object SHA1\n> won't match the object.\n> \n> Signed-off-by: Nicolas Pitre <nico@cam.org>\n> ---\n> \n> If you got a corrupted .idx file because of this ('git verify-pack' \n> should tell) then just toss it and recreate with a fixed 'git \n> index-pack'.\n> \n> Could anyone having problems fetching from kernel.org with git from the \n> next branch confirm that this also fixes that? Thanks.\n\nI still seem to have the same problem after patching:\n\n$ git pull\nremote: Counting objects: 279, done.\nremote: Compressing objects: 100% (78/78), done.\nremote: Total 177 (delta 136), reused 135 (delta 99)\nReceiving objects: 100% (177/177), 66.59 KiB, done.\nfatal: pack has bad object at offset 53487: failed to apply delta\nfatal: index-pack failed\n\n'git verify-pack' does _not_ report an error for either pack or index.\nThis is with git from branch next at 8f0e41f379d486dd27766d84d994eb1da5b8319d\ntrying to pull from git://git.kernel.org/pub/scm/git/git.git\n\nThis is on Debian 'sid' with an AMD64 architecture.\n\nI've put the whole \".git\" directory (warning: almost 35MB) for\ninvestigation at:\n\nhttp://www.xs4all.nl/~fiberbit/http://www.xs4all.nl/~fiberbit/git-next-8f0e41f3-bad-index.tgz\n\nI hope I've patched correctly. After applying (cleanly) and rebuilding\nsimply executing \"./git\" from the workdirectory still uses the old\nversion. Only after using \"make install\" I get the patched version,\nwhich as shown above still gives an error, from the die() at line 528 in\nindex-pack.c: bad_object(delta_obj->idx.offset, \"failed to apply\ndelta\");\n\nNot much more time tonight here, but perhaps it's easier to reproduce\nnow with the copy of an affected .git directory.\n-- \nMarco Roeland\n"},{"id":"93554","messageId":"20081020192051.GA21770@fiberbit.xs4all.nl","threadId":"15981","inReplyTo":"20081020191400.GA18743@fiberbit.xs4all.nl","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Marco Roeland","fromEmail":"marco.roeland@xs4all.nl","sentAt":"2008-10-20T19:20:52Z","receivedAt":"2008-10-20T19:20:52Z","isPatch":true,"sender":{"key":"marco.roeland@xs4all.nl","avatar":null},"body":"Op maandag 20 oktober 2008 om 21:14 uur schreef Marco Roeland het volgende:\n\n> This is on Debian 'sid' with an AMD64 architecture.\n> \n> I've put the whole \".git\" directory (warning: almost 35MB) for\n> investigation at:\n> \n> http://www.xs4all.nl/~fiberbit/http://www.xs4all.nl/~fiberbit/git-next-8f0e41f3-bad-index.tgz\n\nGah, I can't even copy-and-paste:\n\nhttp://www.xs4all.nl/~fiberbit/git-next-8f0e41f3-bad-index.tgz\n\nThis is on a quadcore. I recently experimented with \"git config\npack.threads 0\" but as it didn't seem to speedup anything I removed\nit again. Just mention it on the infinitesimal chance it might be\nimportant.\n-- \nMarco Roeland\n"},{"id":"93553","messageId":"alpine.LFD.2.00.0810201525540.26244@xanadu.home","threadId":"15981","inReplyTo":"20081020192051.GA21770@fiberbit.xs4all.nl","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2008-10-20T19:27:24Z","receivedAt":"2008-10-20T19:27:24Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Mon, 20 Oct 2008, Marco Roeland wrote:\n\n> Op maandag 20 oktober 2008 om 21:14 uur schreef Marco Roeland het volgende:\n> \n> > This is on Debian 'sid' with an AMD64 architecture.\n> > \n> > I've put the whole \".git\" directory (warning: almost 35MB) for\n> > investigation at:\n> > \n> > http://www.xs4all.nl/~fiberbit/http://www.xs4all.nl/~fiberbit/git-next-8f0e41f3-bad-index.tgz\n> \n> Gah, I can't even copy-and-paste:\n> \n> http://www.xs4all.nl/~fiberbit/git-next-8f0e41f3-bad-index.tgz\n\nDon't worry -- I figured it out and was able to reproduce the problem \nalready.  Thanks a lot!\n\n> This is on a quadcore. I recently experimented with \"git config\n> pack.threads 0\" but as it didn't seem to speedup anything I removed\n> it again. Just mention it on the infinitesimal chance it might be\n> important.\n\nIt is not.  And the speedup should be noticeable when you repack, not \nwhen you fetch.\n\n\nNicolas\n"},{"id":"93547","messageId":"20081020193652.GA22123@fiberbit.xs4all.nl","threadId":"15981","inReplyTo":"alpine.LFD.2.00.0810201525540.26244@xanadu.home","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Marco Roeland","fromEmail":"marco.roeland@xs4all.nl","sentAt":"2008-10-20T19:36:52Z","receivedAt":"2008-10-20T19:36:52Z","isPatch":true,"sender":{"key":"marco.roeland@xs4all.nl","avatar":null},"body":"On Monday Oktober 20th 2008 at 15:27 Nicolas Pitre wrote:\n\n> > This is on a quadcore. I recently experimented with \"git config\n> > pack.threads 0\" but as it didn't seem to speedup anything I removed\n> > it again. Just mention it on the infinitesimal chance it might be\n> > important.\n> \n> It is not.  And the speedup should be noticeable when you repack, not \n> when you fetch.\n\nNo offense meant! I tried a few \"git gc\" and \"git repack\" and only\nwatched the Gnome CPU applet; perhaps everything was already nicely\npacked. I'm certainly going to retry now. Thanks for all your good work.\n-- \nMarco Roeland\n"},{"id":"93548","messageId":"alpine.LFD.2.00.0810201601480.26244@xanadu.home","threadId":"15981","inReplyTo":"20081020193652.GA22123@fiberbit.xs4all.nl","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2008-10-20T20:04:05Z","receivedAt":"2008-10-20T20:04:05Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Mon, 20 Oct 2008, Marco Roeland wrote:\n\n> On Monday Oktober 20th 2008 at 15:27 Nicolas Pitre wrote:\n> \n> > > This is on a quadcore. I recently experimented with \"git config\n> > > pack.threads 0\" but as it didn't seem to speedup anything I removed\n> > > it again. Just mention it on the infinitesimal chance it might be\n> > > important.\n> > \n> > It is not.  And the speedup should be noticeable when you repack, not \n> > when you fetch.\n> \n> No offense meant! \n\nOh certainly not.\n\n> I tried a few \"git gc\" and \"git repack\" and only\n> watched the Gnome CPU applet; perhaps everything was already nicely\n> packed. I'm certainly going to retry now. Thanks for all your good work.\n\nIf you want to make the difference really visible, try with\n'git repack -a -f --window=100'.\n\n\nNicolas\n"},{"id":"93555","messageId":"20081020201044.GA20244@coredump.intra.peff.net","threadId":"15981","inReplyTo":"alpine.LFD.2.00.0810201357340.26244@xanadu.home","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-20T20:10:44Z","receivedAt":"2008-10-20T20:10:44Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 20, 2008 at 02:12:04PM -0400, Nicolas Pitre wrote:\n\n> Could anyone having problems fetching from kernel.org with git from the \n> next branch confirm that this also fixes that? Thanks.\n\nNope, this does not fix it for me.\n\n-Peff\n"},{"id":"93523","messageId":"20081020201251.GC22123@fiberbit.xs4all.nl","threadId":"15981","inReplyTo":"alpine.LFD.2.00.0810201601480.26244@xanadu.home","subject":"Re: [PATCH] fix for \"index-pack: rationalize delta resolution code\"","fromName":"Marco Roeland","fromEmail":"marco.roeland@xs4all.nl","sentAt":"2008-10-20T20:12:51Z","receivedAt":"2008-10-20T20:12:51Z","isPatch":true,"sender":{"key":"marco.roeland@xs4all.nl","avatar":null},"body":"On Monday Oktober 20th 2008 at 16:04 Nicolas Pitre wrote:\n\n> If you want to make the difference really visible, try with\n> 'git repack -a -f --window=100'.\n\nImpressive, yes. Thanks very much.\n\nmarco@sirius:~/src/git (next) $ time git repack -a -f --window=100\nCounting objects: 85713, done.\nCompressing objects: 100% (84207/84207), done.\nWriting objects: 100% (85713/85713), done.\nTotal 85713 (delta 62371), reused 0 (delta 0)\n\nreal    1m2.775s\nuser    1m1.848s\nsys     0m0.176s\nmarco@sirius:~/src/git (next) $ git config pack.threads 0\nmarco@sirius:~/src/git (next) $ time git repack -a -f --window=100\nCounting objects: 85713, done.\nCompressing objects: 100% (84207/84207), done.\nWriting objects: 100% (85713/85713), done.\nTotal 85713 (delta 62363), reused 0 (delta 0)\n\nreal    0m21.348s\nuser    1m2.948s\nsys     0m0.432s\nmarco@sirius:~/src/git (next) $ git config --unset pack.threads\nmarco@sirius:~/src/git (next) $ time git repack -a -f --window=100\nCounting objects: 85713, done.\nCompressing objects: 100% (84207/84207), done.\nWriting objects: 100% (85713/85713), done.\nTotal 85713 (delta 62371), reused 0 (delta 0)\n\nreal    1m1.904s\nuser    1m1.476s\nsys     0m0.184s\n\nThis on Intel(R) Core(TM)2 Quad  CPU   Q9450  @ 2.66GHz.\n-- \nMarco Roeland\n"}]}