git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Glen Choo <chooglen@google.com>
Cc: git@vger.kernel.org
Subject: Re: gitformat-index.txt has a gap in the "mode" description?
Date: Tue, 31 Jan 2023 11:26:10 -0800	[thread overview]
Message-ID: <xmqqmt5yy08d.fsf@gitster.g> (raw)
In-Reply-To: <kl6l357qy7r2.fsf@chooglen-macbookpro.roam.corp.google.com> (Glen Choo's message of "Wed, 01 Feb 2023 00:43:45 +0800")

Glen Choo <chooglen@google.com> writes:

> According to gitformat-index.txt [1], "mode" is 32 bits, but we've only
> documented 16 bits. I tried poking around read-cache.c, and my
> impression is that other 16 are just NUL. If so, it would be worth
> documenting that they're unused, especially since we documented
> unused bits right in that section.
>
> [1] https://github.com/git/git/blob/master/Documentation/gitformat-index.txt#L84

Good thinking.  The existing explanation starts with "32-bit mode,
split into (high to low bits)", followed by "4-bit object type", as
if the "4-bit object type" occupies bits 29-32, which is not quite
what we want to say.

By the way, we should avoid saying "unused" but be more explicit and
say "must be zero".  The latter has no ambiguity but the former can
be misinterpreted to allow any garbage.

Thanks.

      reply	other threads:[~2023-01-31 19:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 16:43 gitformat-index.txt has a gap in the "mode" description? Glen Choo
2023-01-31 19:26 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmt5yy08d.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=chooglen@google.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).