git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] t7701: make annotated tag unreachable

From
Jeff King <peff@peff.net>
Date
Jun 27, 2023, 07:09 UTC
Message-ID
<20230627070942.GC1226768@coredump.intra.peff.net>
In-Reply-To
<259b1b559114ab1a9a0bd7f1ad29a4cba2612ae0.1687617197.git.me@ttaylorr.com>
On Sat, Jun 24, 2023 at 10:33:47AM -0400, Taylor Blau wrote:
Show 26 quoted lines
> In 4dc16e2cb0 (gc: introduce `gc.recentObjectsHook`, 2023-06-07), we
> added tests to ensure that prune-able (i.e. unreachable and with mtime
> older than the cutoff) objects which are marked as recent via the new
> `gc.recentObjectsHook` configuration are unpacked as loose with
> `--unpack-unreachable`.
> 
> In that test, we also ensure that objects which are reachable from other
> unreachable objects which were *not* pruned are kept as well, regardless
> of their mtimes. For this, we use an annotated tag pointing at a blob
> ($obj2) which would otherwise be pruned.
> 
> But after pruning, that object is kept around for two reasons. One, the
> tag object's mtime wasn't adjusted to be beyond the 1-hour cutoff, so it
> would be kept as due to its recency regardless. The other reason is
> because the tag itself is reachable.
> 
> Use mktag to write the tag object directly without pointing a reference
> at it, and adjust the mtime of the tag object to be older than the
> cutoff to ensure that our `gc.recentObjectsHook` configuration is
> working as intended.
> 
> Noticed-by: Jeff King <peff@peff.net>
> Signed-off-by: Taylor Blau <me@ttaylorr.com>
> ---
> Fixes a trivial oversight from an earlier version of this patch noticed
> by Peff.
Thanks, this looks great to me.
-Peff
Previous: Taylor Blau
Message 4 of 4 in “t7701: make annotated tag unreachable”
  1. t7701: make annotated tag unreachableTaylor Blau, Jun 21, 2023
  2. Jeff KingJun 24, 2023
  3. t7701: make annotated tag unreachableTaylor Blau, Jun 24, 2023
  4. Jeff KingJun 27, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.