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

Re: [PATCH/RFC 2/4] Use 'lstat_cache()' instead of 'has_symlink_leading_path()'

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2009, 08:19 UTC
Message-ID
<7vk598j17u.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1231161001-32599-3-git-send-email-barvik@broadpark.no>
Kjetil Barvik <barvik@broadpark.no> writes:
Show 11 quoted lines
> Start using the optimised, faster and more effective symlink/directory
> cache.  The previously used call:
>
>    has_symlink_leading_path(len, name);
>
> should be identically with the following call to lstat_cache():
>
>    lstat_cache(len, name,
>                LSTAT_SYMLINK|LSTAT_DIR,
>                LSTAT_SYMLINK);
> ...

Care to enlighten why some of callers use the above, but not others? Namely, check_removed() in diff-lib.c and callers in unpack-trees.c care about NOTDIR unlike others, even though the original code checked for exactly the same condition.

Does this mean that some callers of has_symlink_leading_path() checked only for leading symlinks when they should also have checked for a leading non-directory, and this patch is also a bugfix?

Previous: Kjetil BarvikNext: Kjetil Barvik
Message 9 of 12 in “git checkout: optimise away lots of lstat() calls”
  1. 0/4 git checkout: optimise away lots of lstat() callsKjetil Barvik, Jan 5, 2009
  2. 1/4 Optimised, faster, more effective symlink/directory detectionKjetil Barvik, Jan 5, 2009
  3. Junio C HamanoJan 6, 2009
  4. Junio C HamanoJan 6, 2009
  5. Kjetil BarvikJan 6, 2009
  6. Kjetil BarvikJan 6, 2009
  7. Kjetil BarvikJan 6, 2009
  8. 2/4 Use 'lstat_cache()' instead of 'has_symlink_leading_path()'Kjetil Barvik, Jan 5, 2009
  9. Junio C HamanoJan 6, 2009
  10. Kjetil BarvikJan 6, 2009
  11. 3/4 create_directories() inside entry.c: only check each directory once!Kjetil Barvik, Jan 5, 2009
  12. 4/4 remove the old 'has_symlink_leading_path()' functionKjetil Barvik, Jan 5, 2009

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.