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

Re: [PATCH] doc: technical details about the index file format

From
Alex Riesen <raa.lkml@gmail.com>
Date
Sep 2, 2010, 08:56 UTC
Message-ID
<AANLkTi=wESk38u1XSTL1rd2__eQzHfSuq-EbqooxmcVw@mail.gmail.com>
In-Reply-To
<1283351989-19426-1-git-send-email-pclouds@gmail.com>
2010/9/1 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:
Show 11 quoted lines
> +== Index entry
> +
> +  Index entries are sorted in ascending order on the name field,
> +  interpreted as a string of unsigned bytes. Entries with the same
> +  name are sorted by their stage field.
> +
> +  32-bit ctime seconds, the last time a file's metadata changed
> +    this is stat(2) data
> +
> +  32-bit ctime nanoseconds (modulo 1G)
> +    this is stat(2) data

Maybe I'm missing something, but I failed to find where "modulo 1G" comes from. AFAICS (read-cache.c), the stat data are saved almost unmodified (casted to unsigned int). (BTW, is 1G the Gravitational Constant or what?)

I'm not sure it is safe to assume that every system Git will be ported to defines "unsigned int" to be 32 bits. OTOH, never met one where it is something else. Still, using uint32_t (the POSIX types) in ondisk_cache_entry would be clearer (unlikely alignment issues aside.

Previous: Nguyễn Thái Ngọc DuyNext: Joshua Juran
Message 6 of 22 in “doc: technical details about the index file format”
  1. doc: technical details about the index file formatNguyễn Thái Ngọc Duy, Sep 1, 2010
  2. Ramkumar RamachandraSep 1, 2010
  3. Sverre RabbelierSep 1, 2010
  4. Robin RosenbergSep 1, 2010
  5. doc: technical details about the index file formatNguyễn Thái Ngọc Duy, Sep 1, 2010
  6. Alex RiesenSep 2, 2010
  7. Joshua JuranSep 2, 2010
  8. Junio C HamanoSep 2, 2010
  9. Erik Faye-LundSep 2, 2010
  10. doc: technical details about the index file formatNguyễn Thái Ngọc Duy, Sep 6, 2010
  11. Sverre RabbelierFeb 19, 2011
  12. Nguyen Thai Ngoc DuyFeb 20, 2011
  13. Nguyen Thai Ngoc DuyFeb 26, 2011
  14. Junio C HamanoFeb 26, 2011
  15. Nguyen Thai Ngoc DuyFeb 26, 2011
  16. Junio C HamanoMar 2, 2011
  17. Nguyen Thai Ngoc DuyMar 2, 2011
  18. Junio C HamanoMar 2, 2011
  19. Nguyen Thai Ngoc DuyMar 2, 2011
  20. Drew NorthupMar 2, 2011
  21. Nguyen Thai Ngoc DuySep 1, 2010
  22. Robin RosenbergSep 2, 2010

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.