All of lore.kernel.org
 help / color / mirror / Atom feed
From: Justin Tobler <jltobler@gmail.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Derrick Stolee <stolee@gmail.com>,
	 Taylor Blau <me@ttaylorr.com>
Subject: Re: [PATCH 3/8] t34xx: don't expire reflogs where it matters
Date: Mon, 23 Feb 2026 10:15:17 -0600	[thread overview]
Message-ID: <aZx72rF8OOXryMc5@denethor> (raw)
In-Reply-To: <20260220-b4-pks-maintenance-default-geometric-strategy-v1-3-faeb321ad13b@pks.im>

On 26/02/20 11:15AM, Patrick Steinhardt wrote:
> We have a couple of tests in the t34xx range that rely on reflogs. This
> never really used to be a problem, but in a subsequent commit we will
> change the default maintenance strategy from "gc" to "geometric", and
> this will cause us to drop all reflogs in these tests.
> 
> This may seem surprising and like a bug at first, but it's actually not.
> The main difference between these two strategies is that the "gc"
> strategy will skip all maintenance in case the object database is in a
> well-optimized state. The "geometric" strategy has separate subtasks
> though, and the conditions for each of these tasks is evaluated on a
> case by case basis. This means that even if the object database is in
> good shape, we may still decide to expire reflogs.
> 
> So why is that a problem? The issue is that Git's test suite hardcodes
> the committer and author dates to a date in 2005. Interestingly though,
> these hardcoded dates not only impact the commits, but also the reflog
> entries. The consequence is that all newly written reflog entries are
> immediately considered stale as our reflog expiration threshold is in
> the range of weeks, only. It follows that executing `git reflog expire`
> will thus immediately purge all reflog entries.
> 
> This hasn't been a problem in our test suite by pure chance, as the
> repository shapes simply didn't cause us to perform actual garbage
> collection. But with the upcoming "geometric" strategy we _will_ start
> to execute `git reflog expire`, thus surfacing this issue.

Interesting find.

> Prepare for this by explicitly disabling reflog expiration in tests
> impacted by this upcoming change.

Makes sense.

> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>  t/t3404-rebase-interactive.sh  | 2 ++
>  t/t3406-rebase-message.sh      | 3 +++
>  t/t3431-rebase-fork-point.sh   | 2 ++
>  t/t3432-rebase-fast-forward.sh | 2 ++
>  4 files changed, 9 insertions(+)
> 
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index e778dd8ae4..5e4623f7f1 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -31,6 +31,8 @@ Initial setup:
>  . "$TEST_DIRECTORY"/lib-rebase.sh
>  
>  test_expect_success 'setup' '
> +	git config set gc.reflogExpire never &&
> +	git config set gc.reflogExpireUnreachable never &&

As it may not be immediately obvious, it could be helpful for future
readers to explain in a comment that reflog dates are hardcoded to a
date that would be immediately expired and thus the need for this
configuration.

This patch looks good to me.

-Justin

  parent reply	other threads:[~2026-02-23 16:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20 10:15 [PATCH 0/8] builtin/maintenance: use "geometric" strategy by default Patrick Steinhardt
2026-02-20 10:15 ` [PATCH 1/8] t: fix races caused by background maintenance Patrick Steinhardt
2026-02-23 16:01   ` Justin Tobler
2026-02-20 10:15 ` [PATCH 2/8] t: disable maintenance where we verify object database structure Patrick Steinhardt
2026-02-23 16:07   ` Justin Tobler
2026-02-20 10:15 ` [PATCH 3/8] t34xx: don't expire reflogs where it matters Patrick Steinhardt
2026-02-23  0:48   ` Derrick Stolee
2026-02-23 16:15   ` Justin Tobler [this message]
2026-02-20 10:15 ` [PATCH 4/8] t5400: explicitly use "gc" strategy Patrick Steinhardt
2026-02-20 10:15 ` [PATCH 5/8] t5510: " Patrick Steinhardt
2026-02-20 10:15 ` [PATCH 6/8] t6500: " Patrick Steinhardt
2026-02-20 10:15 ` [PATCH 7/8] t7900: prepare for switch of the default strategy Patrick Steinhardt
2026-02-20 10:15 ` [PATCH 8/8] builtin/maintenance: use "geometric" strategy by default Patrick Steinhardt
2026-02-23  0:52   ` Derrick Stolee
2026-02-23  9:49     ` Patrick Steinhardt
2026-02-23 16:48   ` Justin Tobler
2026-02-24  8:15     ` Patrick Steinhardt
2026-02-23  0:53 ` [PATCH 0/8] " Derrick Stolee
2026-02-24  8:45 ` [PATCH v2 " Patrick Steinhardt
2026-02-24  8:45   ` [PATCH v2 1/8] t: fix races caused by background maintenance Patrick Steinhardt
2026-02-24  8:45   ` [PATCH v2 2/8] t: disable maintenance where we verify object database structure Patrick Steinhardt
2026-02-24  8:45   ` [PATCH v2 3/8] t34xx: don't expire reflogs where it matters Patrick Steinhardt
2026-02-24  8:45   ` [PATCH v2 4/8] t5400: explicitly use "gc" strategy Patrick Steinhardt
2026-02-24  8:45   ` [PATCH v2 5/8] t5510: " Patrick Steinhardt
2026-02-24  8:45   ` [PATCH v2 6/8] t6500: " Patrick Steinhardt
2026-02-25 10:13     ` Toon Claes
2026-02-24  8:45   ` [PATCH v2 7/8] t7900: prepare for switch of the default strategy Patrick Steinhardt
2026-02-24  8:45   ` [PATCH v2 8/8] builtin/maintenance: use "geometric" strategy by default Patrick Steinhardt
2026-02-24 12:12     ` Derrick Stolee
2026-02-25 10:33       ` Toon Claes
2026-02-24 18:54   ` [PATCH v2 0/8] " Justin Tobler

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=aZx72rF8OOXryMc5@denethor \
    --to=jltobler@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=ps@pks.im \
    --cc=stolee@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.