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

Re: [PATCH] Use correct U*MAX.

From
Junio C Hamano <junkio@cox.net>
Date
Jun 4, 2005, 00:09 UTC
Message-ID
<7vslzzj82z.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050604000042.GG13093@pasky.ji.cz>
>>>>> "PB" == Petr Baudis <pasky@ucw.cz> writes:
>> I'd rather see it use the correct U*MAX.

PB> Care to elaborate? It doesn't make sense to me to use any U*MAX stuff PB> there whatsoever. (And how do you define the "correct" U*MAX anyway?)

It just feels wrong to spell a parameter to the function locate_size_cache() "-1" when I know the argument it expects is of type unsigned long. And correct U*MAX for that case is obviously ULONG_MAX, _assuming_ that you agree to the function's (unwritten) calling convention of "passing the largest possible value to me means 'do not create', not 'you are telling me that sha1 is such a large file'".

If you feel strongly about that calling convention, you could rewrite it to take the third argument "int do_not_create" and pass that information separately, which is conceptually cleaner. I just did not think that was worth it for such an internal helper when I wrote it.

Previous: Petr BaudisNext: Junio C Hamano
Message 19 of 20 in “diff: mode bits fixes”
  1. diff: mode bits fixesJunio C Hamano, Jun 1, 2005
  2. Handle deltified object correctly in git-*-pull family.Junio C Hamano, Jun 2, 2005
  3. Linus TorvaldsJun 2, 2005
  4. Handle deltified object correctly in git-*-pull family.Junio C Hamano, Jun 2, 2005
  5. Nicolas PitreJun 2, 2005
  6. Nicolas PitreJun 2, 2005
  7. 1/2 Handle deltified object correctly in git-*-pull family.Junio C Hamano, Jun 2, 2005
  8. Linus TorvaldsJun 2, 2005
  9. 2/2 Find size of SHA1 object without inflating everything.Junio C Hamano, Jun 2, 2005
  10. Find size of SHA1 object without inflating everything.Junio C Hamano, Jun 2, 2005
  11. Linus TorvaldsJun 2, 2005
  12. Junio C HamanoJun 2, 2005
  13. McMullan, JasonJun 2, 2005
  14. Junio C HamanoJun 2, 2005
  15. Use correct U*MAX.Junio C Hamano, Jun 2, 2005
  16. Petr BaudisJun 3, 2005
  17. Junio C HamanoJun 3, 2005
  18. Petr BaudisJun 4, 2005
  19. Junio C HamanoJun 4, 2005
  20. Find size of SHA1 object without inflating everything.Junio C Hamano, Jun 2, 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.