From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org,
"brian m. carlson" <sandals@crustytoothpaste.net>,
Karthik Nayak <karthik.188@gmail.com>
Subject: Re: [PATCH] refs: fix migration of reflogs respecting "core.logAllRefUpdates"
Date: Wed, 22 Jan 2025 10:02:01 -0800 [thread overview]
Message-ID: <xmqqjzamwwva.fsf@gitster.g> (raw)
In-Reply-To: <20250122-b4-pks-reflog-migration-fix-stash-v1-1-27dbae4602f7@pks.im> (Patrick Steinhardt's message of "Wed, 22 Jan 2025 10:48:06 +0100")
Patrick Steinhardt <ps@pks.im> writes:
> In 246cebe320 (refs: add support for migrating reflogs, 2024-12-16) we
> have added support to git-refs(1) to migrate reflogs between reference
> backends. It was reported [1] though that not we don't migrate reflogs
> for a subset of references, most importantly "refs/stash".
>
> This issue is caused by us still honoring "core.logAllRefUpdates" when
> trying to migrate reflogs: we do queue the updates, but depending on the
> value of that config we may decide to just skip writing the reflog entry
> altogether. And given that:
>
> - The default for "core.logAllRefUpdates" is to only create reflogs
> for branches, remotes, note refs and "HEAD"
>
> - "refs/stash" is neither of these ref types.
>
> We end up skipping the reflog creation for that particular reference.
>
> Fix the bug by setting `REF_FORCE_CREATE_REFLOG`, which instructs the
> ref backends to create the reflog entry regardless of the config or any
> preexisting state.
Thanks for a clear problem analysis description. The appraoch makes
perfect sense.
Will queue.
> + test_expect_success "$from_format -> $to_format: stash is retained" '
> + test_when_finished "rm -rf repo" &&
> + git init --ref-format=$from_format repo &&
> + (
> + cd repo &&
> + test_commit initial A &&
> + echo foo >A &&
> + git stash push &&
> + echo bar >A &&
> + git stash push &&
> + git stash list >expect.reflog &&
> + test_migration . "$to_format" &&
> + git stash list >actual.reflog &&
> + test_cmp expect.reflog actual.reflog
> + )
> + '
> done
> done
>
>
> ---
> base-commit: f93ff170b93a1782659637824b25923245ac9dd1
> change-id: 20250122-b4-pks-reflog-migration-fix-stash-d1fe7380f84a
prev parent reply other threads:[~2025-01-22 18:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-22 9:48 [PATCH] refs: fix migration of reflogs respecting "core.logAllRefUpdates" Patrick Steinhardt
2025-01-22 18:02 ` Junio C Hamano [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=xmqqjzamwwva.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
--cc=ps@pks.im \
--cc=sandals@crustytoothpaste.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 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.