]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/refs: add '--no-reflog' flag to drop reflogs
authorKarthik Nayak <karthik.188@gmail.com>
Fri, 21 Feb 2025 10:04:23 +0000 (11:04 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Feb 2025 17:55:02 +0000 (09:55 -0800)
commit89be7d2774f81f3d8663999975a6ab64d46bf42e
tree6d60f04f67240a1d1aff9039e64c347893610188
parente2067b49ecaef9b7f51a17ce251f9207f72ef52d
builtin/refs: add '--no-reflog' flag to drop reflogs

The "git refs migrate" subcommand converts the backend used for ref
storage. It always migrates reflog data as well as refs. Introduce an
option to exclude reflogs from migration, allowing them to be discarded
when they are unnecessary.

This is particularly useful in server-side repositories, where reflogs
are typically not expected. However, some repositories may still have
them due to historical reasons, such as bugs, misconfigurations, or
administrative decisions to enable reflogs for debugging. In such
repositories, it would be optimal to drop reflogs during the migration.

To address this, introduce the '--no-reflog' flag, which prevents reflog
migration. When this flag is used, reflogs from the original reference
backend are migrated. Since only the new reference backend remains in
the repository, all previous reflogs are permanently discarded.

Helped-by: Junio C Hamano <gitster@pobox.com>
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
builtin/refs.c
refs.c
refs.h
t/t1460-refs-migrate.sh