From: Johannes Schindelin Date: Sun, 12 Feb 2006 17:26:50 GMT Subject: Re: ***DONTUSE*** Re: [PATCH] Use a hashtable for objects instead of a sorted list Message-ID: In-Reply-To: <7virrkbsgp.fsf@assigned-by-dhcp.cox.net> Hi, On Sun, 12 Feb 2006, Junio C Hamano wrote: > The problem does not seem to trigger with casual use, but I > found that with a clone from my primary repository with '-l -s' > (that is, a clone that uses alternates mechanism to borrow from > my primary repository), fsck-objects built with the patch seems > to report bogus things "missing". I have not traced it fully; > instead I ended up spending most of the night (I noticed it at > around 01:30 and now it is 05:30 so that's about four hours) > recovering some of my refs and double checking if my primary > repository is not corrupt X-<. At least, the primary repository > looks sane now. Could it be the shallow thing? + +void for_each_object(void (*fn)(struct object *)) +{ + int i; + for (i = 0; i < nr_objs; i++) + fn(objs[i]); +} This will not work with the hashtable. It has to be something like void for_each_object(void (*fn)(struct object *)) { int i; for (i = 0; i < obj_allocs; i++) if (objs[i]) fn(objs[i]); } This error did not trigger here, since I don't use shallow clones. Again, sorry for the inconvenience, Junio. Hth, Dscho