git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org,  Jeff King <peff@peff.net>
Subject: Re: [PATCH] pack-bitmap.c: typofix in `find_boundary_objects()`
Date: Fri, 22 Nov 2024 09:39:07 +0900	[thread overview]
Message-ID: <xmqqiksgdrv8.fsf@gitster.g> (raw)
In-Reply-To: <cf49115db4e8dcd406a17c946659c2eef3ec6045.1732229420.git.me@ttaylorr.com> (Taylor Blau's message of "Thu, 21 Nov 2024 17:50:43 -0500")

Taylor Blau <me@ttaylorr.com> writes:

> Fix that by correctly assigning the value of 'revs->tag_objects' to the
> 'tmp_tags' field.

Makes sense.  This breakage would make no difference in practice
right now, as {type}_objects members of the rev_info structure have
always been all flipped on together since their inception at
3c90f03d (Prepare git-rev-list for tracking tag objects too,
2005-06-29), so the original value of the tag_objects member is
always the same as that of the blob_objects member.

A possible alternative "fix" for this typo could be to unify these
{type}_objects members into a single .non_commit_objects member in
the rev_info structure; given that we (as far as I remember) never
utilized the "feature" that, say, we can ask only for trees but not
blobs for the past ~20 years, nobody knows if the apparent "support"
for that feature is subtly broken in multiple ways (and one of them
you just fixed with this patch) and the "feature" may not be worth
keeping.

But neverhteless, this is a correct thing to do unless we decide to
rip out the support for individual types.  Will queue.

Thanks.



>
> Signed-off-by: Taylor Blau <me@ttaylorr.com>
> ---
> Noticed while I was looking for an example of this pattern somewhere in
> the codebase and was surprised when I found this typo ;-).
>
>  pack-bitmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pack-bitmap.c b/pack-bitmap.c
> index 4fa9dfc771..683f467051 100644
> --- a/pack-bitmap.c
> +++ b/pack-bitmap.c
> @@ -1270,7 +1270,7 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
>
>  	tmp_blobs = revs->blob_objects;
>  	tmp_trees = revs->tree_objects;
> -	tmp_tags = revs->blob_objects;
> +	tmp_tags = revs->tag_objects;
>  	revs->blob_objects = 0;
>  	revs->tree_objects = 0;
>  	revs->tag_objects = 0;
>
> base-commit: 4083a6f05206077a50af7658bedc17a94c54607d
> --
> 2.47.0.237.gc601277f4c4

  reply	other threads:[~2024-11-22  0:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21 22:50 [PATCH] pack-bitmap.c: typofix in `find_boundary_objects()` Taylor Blau
2024-11-22  0:39 ` Junio C Hamano [this message]
2024-11-22 15:41   ` Jeff King
2024-11-22 15:44     ` Jeff King
2024-11-25  2:29       ` Junio C Hamano

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=xmqqiksgdrv8.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    /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).