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

Re: [PATCH 0/3] Using a bit more decoration

From
Jeff King <peff@peff.net>
Date
Apr 9, 2013, 04:39 UTC
Message-ID
<20130409043938.GA31447@sigill.intra.peff.net>
In-Reply-To
<7vsj30tk0p.fsf@alter.siamese.dyndns.org>
On Mon, Apr 08, 2013 at 09:17:42PM -0700, Junio C Hamano wrote:
Show 14 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > [1] The thing that made me think about this was making a version of
> >     paint_down_to_common that could keep a separate color for each
> >     source, rather than only PARENT1 and PARENT2. That would let us do
> >     the "--contains" traversal in a breadth-first way, but calculate the
> >     answer simultaneously for all sources (i.e., avoid the depth-first
> >     "go to roots" problem that the current "tag --contains" has if you
> >     do not use timestamp cutoffs).
> 
> Yes, show-branch operates independently of rev-list machinery, hence
> can use full set of bits, but the full set of bits in a word is not
> always sufficient and it can be helped greatly with such an unbound
> set of bits machinery.

The tricky part is how to store the index for each commit (or object). I don't see a way around adding a new field to "struct commit" to do so. It _might_ be worth it, because that index would be reusable for many different operations.

I had hoped to do something clever and implicit with the commit pointer, since we allocate from a pool. For example, if you have pointer X and know that the pool starts at Y, you can get an index with simple subtraction. But of course we don't know what the pool is for any given allocator without searching the pools, which grow linearly with the number of objects. So it ends up with the same algorithmic complexity as just searching for the commit in a data structure (albeit with a smaller constant, since we allocate big chunks of objects).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 15 in “decorate: add "clear_decoration()"”
  1. 2/2 decorate: add "clear_decoration()"Junio C Hamano, Apr 8, 2013
  2. Jeff KingApr 8, 2013
  3. Junio C HamanoApr 8, 2013
  4. 0/3 Using a bit more decorationJunio C Hamano, Apr 8, 2013
  5. 1/3 commit: shrink "indegree" fieldJunio C Hamano, Apr 8, 2013
  6. Jeff KingApr 9, 2013
  7. 2/3 commit: rename parse_commit_date()Junio C Hamano, Apr 8, 2013
  8. 3/3 commit: add get_commit_encoding()Junio C Hamano, Apr 8, 2013
  9. Jeff KingApr 9, 2013
  10. Junio C HamanoApr 9, 2013
  11. Jeff KingApr 9, 2013
  12. Junio C HamanoApr 9, 2013
  13. Jeff KingApr 9, 2013
  14. Junio C HamanoApr 9, 2013
  15. Junio C HamanoApr 9, 2013

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.