git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: ***DONTUSE*** Re: [PATCH] Use a hashtable for objects instead of a sorted list

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 12, 2006, 17:26 UTC
Message-ID
<Pine.LNX.4.63.0602121822060.21959@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7virrkbsgp.fsf@assigned-by-dhcp.cox.net>
Hi,
On Sun, 12 Feb 2006, Junio C Hamano wrote:
Show 10 quoted lines
> 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

Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 21 in “Optimization for git-rev-list --objects”
  1. Optimization for git-rev-list --objectsAlexandre Julliard, Feb 11, 2006
  2. Use a hashtable for objects instead of a sorted listJohannes Schindelin, Feb 12, 2006
  3. Junio C HamanoFeb 12, 2006
  4. Alexandre JulliardFeb 12, 2006
  5. Junio C HamanoFeb 12, 2006
  6. Johannes SchindelinFeb 12, 2006
  7. Florian WeimerFeb 12, 2006
  8. ***DONTUSE*** Re: [PATCH] Use a hashtable for objects instead of a sorted listJunio C Hamano, Feb 12, 2006
  9. ***DONTUSE*** Re: [PATCH] Use a hashtable for objects instead of a sorted listJunio C Hamano, Feb 12, 2006
  10. Johannes SchindelinFeb 12, 2006
  11. Junio C HamanoFeb 12, 2006
  12. Linus TorvaldsFeb 12, 2006
  13. Junio C HamanoFeb 12, 2006
  14. binary-tree-based objects.Junio C Hamano, Feb 12, 2006
  15. Linus TorvaldsFeb 12, 2006
  16. Linus TorvaldsFeb 12, 2006
  17. Linus TorvaldsFeb 12, 2006
  18. Junio C HamanoFeb 12, 2006
  19. Junio C HamanoFeb 12, 2006
  20. Linus TorvaldsFeb 12, 2006
  21. Linus TorvaldsFeb 12, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.