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

Re: [PATCH v4 2/4] path: optimize common dir checking

From
David Turner <dturner@twopensource.com>
Date
Aug 26, 2015, 22:10 UTC
Message-ID
<1440627031.26055.5.camel@twopensource.com>
In-Reply-To
<xmqqwpwh21ky.fsf@gitster.dls.corp.google.com>
On Wed, 2015-08-26 at 14:15 -0700, Junio C Hamano wrote:
Show 10 quoted lines
> > + * For example, consider the following set of strings:
> > + * abc
> > + * def
> > + * definite
> > + * definition
> > + *
> > + * The trie would look look like:
> > + * root: len = 0, value = (something), children a and d non-NULL.
> 
> "value = NULL", as there is no empty string registered in the trie?
Indeed.
> > + *    a: len = 2, contents = bc
> 
> "value = NULL" here, too (just showing I am following along, not
> just skimming)?
Yep.
<snip>
Show 7 quoted lines
> > +	/* Partial path normalization: skip consecutive slashes */
> > +	while (key[0] == '/' && key[1] == '/')
> > +		key ++;
> 
> These "skipping consecutive slashes" inside this function is cute.
> I would have expected me to react "Eek, Ugly" to it, but somehow I
> didn't find them ugly.
It's right on the cute/ugly edge for me too.
<snip>
> I somehow wonder if we'd want to precomute the trie at the build
> time, though ;-)
LOL.
<snip>
> Thanks for a pleasant read.

Thank you! I'll re-roll with those last two fixes (re value=NULL) tomorrow-ish.

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 13 in “per-worktree bisection refs”
  1. 0/4 per-worktree bisection refsDavid Turner, Aug 26, 2015
  2. 1/4 refs: clean up common_listDavid Turner, Aug 26, 2015
  3. 2/4 path: optimize common dir checkingDavid Turner, Aug 26, 2015
  4. Junio C HamanoAug 26, 2015
  5. David TurnerAug 26, 2015
  6. Junio C HamanoAug 26, 2015
  7. David TurnerAug 26, 2015
  8. Junio C HamanoAug 28, 2015
  9. David TurnerAug 28, 2015
  10. Torsten BögershausenAug 30, 2015
  11. David TurnerAug 31, 2015
  12. 3/4 refs: make refs/worktree/* per-worktreeDavid Turner, Aug 26, 2015
  13. 4/4 bisect: make bisection refs per-worktreeDavid Turner, Aug 26, 2015

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.