{"thread":{"id":"59166","subject":"gitformat-index.txt has a gap in the \"mode\" description?","startedAt":"2023-01-31T16:43:50Z","lastAt":"2023-01-31T19:26:21Z","messageCount":2,"participants":["Glen Choo","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"471191","messageId":"kl6l357qy7r2.fsf@chooglen-macbookpro.roam.corp.google.com","threadId":"59166","inReplyTo":null,"subject":"gitformat-index.txt has a gap in the \"mode\" description?","fromName":"Glen Choo","fromEmail":"chooglen@google.com","sentAt":"2023-01-31T16:43:45Z","receivedAt":"2023-01-31T16:43:50Z","isPatch":false,"sender":{"key":"glencbz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/58092771?v=4"},"body":"\nAccording to gitformat-index.txt [1], \"mode\" is 32 bits, but we've only\ndocumented 16 bits. I tried poking around read-cache.c, and my\nimpression is that other 16 are just NUL. If so, it would be worth\ndocumenting that they're unused, especially since we documented\nunused bits right in that section.\n\n[1] https://github.com/git/git/blob/master/Documentation/gitformat-index.txt#L84\n"},{"id":"471196","messageId":"xmqqmt5yy08d.fsf@gitster.g","threadId":"59166","inReplyTo":"kl6l357qy7r2.fsf@chooglen-macbookpro.roam.corp.google.com","subject":"Re: gitformat-index.txt has a gap in the \"mode\" description?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-01-31T19:26:10Z","receivedAt":"2023-01-31T19:26:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Glen Choo <chooglen@google.com> writes:\n\n> According to gitformat-index.txt [1], \"mode\" is 32 bits, but we've only\n> documented 16 bits. I tried poking around read-cache.c, and my\n> impression is that other 16 are just NUL. If so, it would be worth\n> documenting that they're unused, especially since we documented\n> unused bits right in that section.\n>\n> [1] https://github.com/git/git/blob/master/Documentation/gitformat-index.txt#L84\n\nGood thinking.  The existing explanation starts with \"32-bit mode,\nsplit into (high to low bits)\", followed by \"4-bit object type\", as\nif the \"4-bit object type\" occupies bits 29-32, which is not quite\nwhat we want to say.\n\nBy the way, we should avoid saying \"unused\" but be more explicit and\nsay \"must be zero\".  The latter has no ambiguity but the former can\nbe misinterpreted to allow any garbage.\n\nThanks.\n"}]}