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

Re: [PATCH 5/5] path.c: don't call the match function without value in trie_find()

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 24, 2019, 03:29 UTC
Message-ID
<xmqq5zkehld3.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20191023162048.GI4348@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
> I'm not sure what you mean by "consistency check".  The resulting trie
> looked as expected both before and after b9317d55a3, i.e. each trie
> node had the right contents, value, and children, as far as I could
> tell.  The issue was in the lookup function.

I saw the change to the code as a band-aid, which wouldn't have been necessary if we had the missing refs/ entry. Fully populating the leading levels explicitly may give the application more flexibility by yielding results different from hardcoded -1 like the patched code gives.

But perhaps treating a path that matches a missing intermediate level just like a path that did not match anything in the trie is what we want anyway, so I guess the code change was the right thing (as opposed to a band-aid).

Thanks.
Previous: SZEDER GáborNext: Johannes Schindelin
Message 11 of 14 in “path.c: a couple of common dir/trie fixes”
  1. 0/5 path.c: a couple of common dir/trie fixesSZEDER Gábor, Oct 21, 2019
  2. 1/5 Documentation: mention more worktree-specific exceptionsSZEDER Gábor, Oct 21, 2019
  3. 3/5 path.c: mark 'logs/HEAD' in 'common_list' as fileSZEDER Gábor, Oct 21, 2019
  4. 2/5 path.c: clarify trie_find()'s in-code commentSZEDER Gábor, Oct 21, 2019
  5. 4/5 path.c: clarify two field names in 'struct common_dir'SZEDER Gábor, Oct 21, 2019
  6. 5/5 path.c: don't call the match function without value in trie_find()SZEDER Gábor, Oct 21, 2019
  7. David TurnerOct 21, 2019
  8. SZEDER GáborOct 21, 2019
  9. Junio C HamanoOct 23, 2019
  10. SZEDER GáborOct 23, 2019
  11. Junio C HamanoOct 24, 2019
  12. Johannes SchindelinOct 28, 2019
  13. SZEDER GáborOct 28, 2019
  14. Johannes SchindelinOct 28, 2019

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.