git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] builtin/refs: add '--skip-reflog' flag to bypass reflog migration

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 12, 2025, 22:25 UTC
Message-ID
<xmqqa5aqu7g9.fsf@gitster.g>
In-Reply-To
<20250212-477-refs-migrate-add-a-flag-to-ignore-reflogs-during-migration-v3-1-98b2c4d2bb0c@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 13 quoted lines
> The 'git-refs(1)' migrate subcommand, which transfers repositories
> between reference backends, currently migrates reflogs by default as of
> 246cebe320 (refs: add support for migrating reflogs, 2024-12-16).
>
> While this behavior is desirable for most client-side repositories,
> server-side repositories are not expected to contain reflogs. However,
> due to historical reasons, some may still have them. This could be
> caused, for example, by bugs, misconfiguration, or an administrator
> enabling reflogs on the server for debugging purposes.
>
> To address this, introduce the --skip-reflog flag, allowing users to
> bypass reflog migration. This ensures that the repository ends up in the
> expected state after migration.
I do not quite understand the motivation behind this change.

If a repository has reflog that you do not need by mistake or misconfiguration, I agree that there should be a way for you to remove the reflog. Removing it while converting the ref backend may be a convenient way if and only if the reason why you noticed such a repository with unwanted reflog is because you were about to migrate it, but regardless of when you notice such refs with unwanted log, you would want to be able to drop their logs. You may not even be planning to migrate your backend when you noticed that the refs have unwanted log, you may have already migrated long time ago when you noticed that the refs have unwanted log, or you may not even be planning to migrate in the first place. Even after you migrated your backend, an administrator may have to enable reflog for debugging, and then after the administrator is done, then what? Should the backend migrated back from reftable to files and then back again, only to pass this --skip-reflog option?

Wouldn't it be a lot more flexible if you add a new subcommand "drop" to the "git reflog" command?

Previous: Karthik NayakNext: Karthik Nayak
Message 12 of 26 in “builtin/refs: add '--skip-reflog' flag to bypass reflog migration”
  1. builtin/refs: add '--skip-reflog' flag to bypass reflog migrationKarthik Nayak, Feb 7, 2025
  2. Patrick SteinhardtFeb 7, 2025
  3. Karthik NayakFeb 11, 2025
  4. Justin ToblerFeb 7, 2025
  5. Karthik NayakFeb 11, 2025
  6. builtin/refs: add '--skip-reflog' flag to bypass reflog migrationKarthik Nayak, Feb 11, 2025
  7. Patrick SteinhardtFeb 11, 2025
  8. Junio C HamanoFeb 11, 2025
  9. Karthik NayakFeb 12, 2025
  10. Karthik NayakFeb 13, 2025
  11. builtin/refs: add '--skip-reflog' flag to bypass reflog migrationKarthik Nayak, Feb 12, 2025
  12. Junio C HamanoFeb 12, 2025
  13. Karthik NayakFeb 13, 2025
  14. Junio C HamanoFeb 13, 2025
  15. Karthik NayakFeb 14, 2025
  16. Toon ClaesFeb 19, 2025
  17. Junio C HamanoFeb 19, 2025
  18. Karthik NayakFeb 19, 2025
  19. Junio C HamanoFeb 19, 2025
  20. Karthik NayakFeb 20, 2025
  21. builtin/refs: add '--no-reflog' flag to drop reflogsKarthik Nayak, Feb 20, 2025
  22. Junio C HamanoFeb 20, 2025
  23. Karthik NayakFeb 21, 2025
  24. builtin/refs: add '--no-reflog' flag to drop reflogsKarthik Nayak, Feb 21, 2025
  25. Junio C HamanoFeb 21, 2025
  26. Karthik NayakFeb 23, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.