]> git.ipfire.org Git - thirdparty/git.git/commit
refs: add support for migrating reflogs
authorKarthik Nayak <karthik.188@gmail.com>
Mon, 16 Dec 2024 16:44:33 +0000 (17:44 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Dec 2024 17:45:34 +0000 (09:45 -0800)
commit246cebe3205694ce19eceaa795d20f24ba762c49
treeed5b2da3ac8df97bde77536aa1f5329be0c6a62a
parent297c09eabb1e8b44230bca86fc7fd344175e0be7
refs: add support for migrating reflogs

The `git refs migrate` command was introduced in
25a0023f28 (builtin/refs: new command to migrate ref storage formats,
2024-06-06) to support migrating from one reference backend to another.

One limitation of the command was that it didn't support migrating
repositories which contained reflogs. A previous commit, added support
for adding reflog updates in ref transactions. Using the added
functionality bake in reflog support for `git refs migrate`.

To ensure that the order of the reflogs is maintained during the
migration, we add the index for each reflog update as we iterate over
the reflogs from the old reference backend. This is to ensure that the
order is maintained in the new backend.

Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-refs.txt
refs.c
t/t1460-refs-migrate.sh