Subject: Re: [PATCH v5] builtin/refs: add '--no-reflog' flag to drop reflogs

From: Junio C Hamano <[email-masked]>
Date: Fri, 21 Feb 2025 09:54:00 -0800

Karthik Nayak <[email-masked]> writes:

> 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 <[email-masked]>
> Helped-by: Patrick Steinhardt <[email-masked]>
> Signed-off-by: Karthik Nayak <[email-masked]>
> ---
>  Documentation/git-refs.txt | 11 ++++++++---
>  builtin/refs.c             |  3 +++
>  refs.c                     |  8 +++++---
>  refs.h                     |  5 ++++-
>  t/t1460-refs-migrate.sh    | 28 ++++++++++++++++++++++++----
>  5 files changed, 44 insertions(+), 11 deletions(-)
>
> Changes in v5:
> - Add missing documentation and cleanup the commit message.
> - I also see that 'git-refs.txt' in master has been renamed to 'git-refs.adoc',
>   but I'm going to avoid rebasing on latest master, since the resolution is
>   quite simple here. Happy to do it if needed. 

It is a good rule of thumb to refrain from rebasing when in doubt.

Shall we declare victory and mark the topic for 'next' by now?

Thanks.