Git development
 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>,
	 Elijah Newren <newren@gmail.com>,
	 Patrick Steinhardt <ps@pks.im>
Subject: Re: [RFC PATCH 08/10] pack-objects: introduce '--stdin-packs=follow-reachable'
Date: Fri, 26 Jun 2026 14:39:10 -0700	[thread overview]
Message-ID: <xmqqpl1d56dd.fsf@gitster.g> (raw)
In-Reply-To: <e3d2e46443d0b32ce29215563dde04ebcf850679.1782500507.git.me@ttaylorr.com> (Taylor Blau's message of "Fri, 26 Jun 2026 15:02:37 -0400")

Taylor Blau <me@ttaylorr.com> writes:

> +/*
> + * Flag bit set on commits that belong to an included pack during
> + * '--stdin-packs=follow-reachable'. Used by the pre-walk to
> + * identify which reachable commits should be tips for the main
> + * object traversal.
> + */
> +#define IN_INCLUDED_PACK (1u<<11)
> +
> +static int mark_included_pack_tip(const struct object_id *oid,
> +				  struct packed_git *p,
> +				  uint32_t pos,
> +				  void *data)
> +{
> +	struct rev_info *main_revs = data;
> +	off_t ofs = nth_packed_object_offset(p, pos);
> +	enum object_type type;
> +	struct object_info oi = OBJECT_INFO_INIT;
> +	struct object *obj;
> +
> +	oi.typep = &type;
> +	if (packed_object_info(p, ofs, &oi) < 0)
> +		return 0;
> +	if (type != OBJ_COMMIT && type != OBJ_TAG)
> +		return 0;

We do not care about non commits, non tags.

> +	obj = parse_object(the_repository, oid);
> +	if (!obj)
> +		return 0;
> +
> +	obj->flags |= IN_INCLUDED_PACK;
> +
> +	if (type == OBJ_TAG && main_revs)
> +		add_pending_object(main_revs, obj, "");

Any tag object is added to the pending list of the second phase
traversal here.  Doesn't this retain unreachable tags and
(unreachable) objects that are only reachable from these unreachable
tags found in the packfile?  Don't we want to limit this code to add
only tags that actually are reachable from refs, or something?

> +	return 0;
> +}

The other function ...

> +static int mark_loose_object_tip(const struct object_id *oid,
> +				 struct object_info *oi UNUSED,
> +				 void *data)

... is structured in a very similar way, and gives the same
puzzlement to me.

  reply	other threads:[~2026-06-26 21:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 19:02 [RFC PATCH 00/10] repack: combine '--geometric' and '--cruft' Taylor Blau
2026-06-26 19:02 ` [RFC PATCH 01/10] repack: unconditionally exclude non-kept packs Taylor Blau
2026-06-26 19:02 ` [RFC PATCH 02/10] repack: extract `locate_existing_pack()` helper Taylor Blau
2026-06-26 19:02 ` [RFC PATCH 03/10] repack: mark geometric progression of packs as retained Taylor Blau
2026-06-26 19:02 ` [RFC PATCH 04/10] repack: teach MIDX retention about geometric rollups Taylor Blau
2026-06-26 21:28   ` Junio C Hamano
2026-06-26 19:02 ` [RFC PATCH 05/10] repack: delete geometric packs via existing_packs Taylor Blau
2026-06-26 19:02 ` [RFC PATCH 06/10] repack-geometry: drop unused redundant-pack removal Taylor Blau
2026-06-26 19:02 ` [RFC PATCH 07/10] pack-objects: extract `stdin_packs_add_all_pack_entries()` Taylor Blau
2026-06-26 19:02 ` [RFC PATCH 08/10] pack-objects: introduce '--stdin-packs=follow-reachable' Taylor Blau
2026-06-26 21:39   ` Junio C Hamano [this message]
2026-06-26 19:02 ` [RFC PATCH 09/10] pack-objects: support '--refs-snapshot' with 'follow-reachable' Taylor Blau
2026-06-26 19:02 ` [RFC PATCH 10/10] repack: support combining '--geometric' with '--cruft' Taylor Blau

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=xmqqpl1d56dd.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    --cc=ps@pks.im \
    /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