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

Re: [PATCH] Introduce SHA1_FILE_DIRECTORIES

From
Sean <seanlkml@sympatico.ca>
Date
May 7, 2005, 00:32 UTC
Message-ID
<2721.10.10.10.24.1115425962.squirrel@linux1>
In-Reply-To
<7vis1vc27f.fsf@assigned-by-dhcp.cox.net>
On Fri, May 6, 2005 8:24 pm, Junio C Hamano said:
Show 14 quoted lines
>>>>>> "S" == Sean  <seanlkml@sympatico.ca> writes:
>
> S> has_sha1_file can be reduced to:
>
> S> int has_sha1_file(const unsigned char *sha1)
> S> {
> S>        return (!!find_sha1_file(sha1));
> S> }
>
> Not really.  If you do not have alternates it does not even
> bother to stat so you get the path that supposed to contain the
> data and you need to do the checking yourself.
>
>

Perhaps I'm just missing something in your code, but this fragment makes it look to me that stat is always called in find_sha1_file even when there are no alternates:

+        char *name = sha1_file_name(sha1);
[...]
+        if (!stat(name, &st))
+                return name;
+        for (i = 0; i < num_alt; i++) {
Sean
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 30 in “Introduce SHA1_FILE_DIRECTORIES”
  1. Introduce SHA1_FILE_DIRECTORIESJunio C Hamano, May 6, 2005
  2. SeanMay 7, 2005
  3. Junio C HamanoMay 7, 2005
  4. SeanMay 7, 2005
  5. Junio C HamanoMay 7, 2005
  6. Junio C HamanoMay 7, 2005
  7. H. Peter AnvinMay 9, 2005
  8. Junio C HamanoMay 9, 2005
  9. SeanMay 9, 2005
  10. H. Peter AnvinMay 9, 2005
  11. Junio C HamanoMay 9, 2005
  12. [RFC] Renaming environment variables.Junio C Hamano, May 9, 2005
  13. Thomas GlanzmannMay 9, 2005
  14. Petr BaudisMay 10, 2005
  15. SeanMay 9, 2005
  16. Daniel BarkalowMay 9, 2005
  17. Junio C HamanoMay 10, 2005
  18. Petr BaudisMay 10, 2005
  19. Junio C HamanoMay 10, 2005
  20. Petr BaudisMay 10, 2005
  21. Daniel BarkalowMay 10, 2005
  22. Petr BaudisMay 10, 2005
  23. Daniel BarkalowMay 10, 2005
  24. Junio C HamanoMay 10, 2005
  25. Introducing GIT_DIR environment variable.Junio C Hamano, May 10, 2005
  26. Alex RiesenMay 10, 2005
  27. Junio C HamanoMay 10, 2005
  28. Daniel BarkalowMay 10, 2005
  29. Petr BaudisMay 10, 2005
  30. Junio C HamanoMay 10, 2005

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.