Git development
 help / color / mirror / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Kristofer Karlsson via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Cc: Kristofer Karlsson <krka@spotify.com>
Subject: Re: [PATCH v2] commit: remove padding from struct commit
Date: Fri, 13 Nov 2026 09:57:29 -0500	[thread overview]
Message-ID: <29490124-5020-42a1-978f-0f5283ba9e11@gmail.com> (raw)
In-Reply-To: <pull.2309.v2.git.1794576606249.gitgitgadget@gmail.com>

On 11/13/2026 8:30 AM, Kristofer Karlsson via GitGitGadget wrote:
> From: Kristofer Karlsson <krka@spotify.com>

>  struct commit {
> +	/*
> +	 * Must be the first member, so that a "struct object *" can be
> +	 * cast to a "struct commit *".
> +	 */
>  	struct object object;

I think your comment is backwards: We cast a commit into an object
and it works. We can't cast an arbitrary object to a commit.

But maybe that direction _does_ happen if we check the object type
and see that it's actually a commit underneath.

> +
> +	/*
> +	 * Index into the commit-slab arrays: unique per in-core commit,
> +	 * and only meaningful within the current process.
> +	 */
> +	unsigned int index;
> +
> +	/*
> +	 * The committer date taken from the commit object, without any
> +	 * adjustment.
> +	 */
>  	timestamp_t date;
> +

Perhaps instead of "taken from the commit object" you could say
"as specified by the commit object" because we may actually load
the date from the commit-graph file instead of parsing a commit
object.

My comments are only nitpicks that _might_ improve the comments.
But they might not, so do what you will.

Thanks,
-Stolee


      reply	other threads:[~2026-11-13 14:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 16:14 [PATCH] commit: remove padding from struct commit Kristofer Karlsson via GitGitGadget
2026-11-12 18:00 ` Derrick Stolee
2026-11-12 21:46   ` Kristofer Karlsson
2026-11-12 19:22 ` Junio C Hamano
2026-11-12 21:35   ` Kristofer Karlsson
2026-11-13 13:30 ` [PATCH v2] " Kristofer Karlsson via GitGitGadget
2026-11-13 14:57   ` Derrick Stolee [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=29490124-5020-42a1-978f-0f5283ba9e11@gmail.com \
    --to=stolee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=krka@spotify.com \
    /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