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

Tree with leading '0' modes in 1.7.0.3

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 26, 2010, 21:56 UTC
Message-ID
<20100326215600.GA10910@spearce.org>

Mike (CC'd) found a bad Git tree today, where the modes for subtrees where formatted using a leading '0':

  $ od -c tree
  0000000   1   0   0   6   4   4       R   E   A   D   M   E  \0 244  \r
  0000020 233 214 350 375   0 263 374 227 264 343   $ 031 027   ` 373 301
  0000040   !   h   0   4   0   0   0   0       m   o   d   u   l   e   s
  0000060  \0 262   z   K 240   4 377   \ 245   C   c   " 231 377  \n   t
  0000100   ,  \n   O   R   E   0   4   0   0   0   0       s   t   e   w
  0000120   a   r   d   b   o   t  \0 037  \b   5 262 345 234 034 303   C
  0000140 373 335 207 300   u 341 277  \f   ] 320 207
  0000153

The '0' on the 3rd line after '! h' is wrong. It shouldn't be here. Likewise the '0' on the 5th line after "O R E" is also wrong. At least its consistently broken. But its still broken by fsck standards:

 $ git fsck --full a39aa6d
 warning in tree a39aa6d4a6dcfd6c14d8f818bbdf1dfcb3e11771: contains zero-padded file modes

Mike claims this tree was created with git-core 1.7.0.3. This thread actually started over on Gerrit Code Review's mailing list [1], because JGit refuses to allow this malformed tree mode to pass its fsck implementation.

Any ideas?  Why is Git 1.7.0.3 jamming a leading '0' on a file mode?
[1] https://groups.google.com/group/repo-discuss/browse_thread/thread/6ff8d7ffba5a9775
-- 
Shawn.
Next: Jonathan Nieder
Message 1 of 33 in “Tree with leading '0' modes in 1.7.0.3”
  1. Shawn O. PearceMar 26, 2010
  2. Jonathan NiederMar 26, 2010
  3. Shawn O. PearceMar 26, 2010
  4. Jonathan NiederMar 26, 2010
  5. Junio C HamanoMar 26, 2010
  6. Mike.lifeguardMar 26, 2010
  7. Shawn O. PearceMar 26, 2010
  8. Mike.lifeguardMar 26, 2010
  9. Jonathan NiederMar 26, 2010
  10. Junio C HamanoMar 26, 2010
  11. Avery PennarunMar 26, 2010
  12. Mike.lifeguardMar 27, 2010
  13. Shawn O. PearceMar 27, 2010
  14. Nicolas PitreMar 27, 2010
  15. Shawn O. PearceMar 27, 2010
  16. Nicolas PitreMar 27, 2010
  17. Avery PennarunMar 27, 2010
  18. Scott ChaconMar 27, 2010
  19. Nicolas PitreMar 27, 2010
  20. Shawn O. PearceMar 27, 2010
  21. A Large Angry SCMMar 27, 2010
  22. Shawn O. PearceMar 27, 2010
  23. A Large Angry SCMMar 27, 2010
  24. A Large Angry SCMMar 27, 2010
  25. A Large Angry SCMMar 27, 2010
  26. Sitaram ChamartyMar 28, 2010
  27. A Large Angry SCMMar 28, 2010
  28. A Large Angry SCMMar 27, 2010
  29. Junio C HamanoMar 27, 2010
  30. Avery PennarunMar 27, 2010
  31. Junio C HamanoMar 27, 2010
  32. Shawn O. PearceMar 27, 2010
  33. Junio C HamanoMar 27, 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.