git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Subject: [PATCH 0/6] reflog: introduce subcommand to list reflogs
Date: Mon, 19 Feb 2024 15:35:14 +0100	[thread overview]
Message-ID: <cover.1708353264.git.ps@pks.im> (raw)

[-- Attachment #1: Type: text/plain, Size: 3051 bytes --]

Hi,

this patch series introduces a new `git reflog list` subcommand that
lists all reflogs of the current repository. This addresses an issue
with discoverability as there is no way for a user to learn about which
reflogs exist. While this isn't all that bad with the "files" backend as
a user could in the worst case figure out which reflogs exist by walking
the ".git/logs" directory, with the "reftable" backend it's basically
impossible to achieve this.

While I think this is sufficient motivation to have such a subcommand
nowadays already, I think the need for such a thing will grow in the
future. It was noted in multiple threads that we may eventually want to
lift the artificial limitations in the "reftable" backend where reflogs
are deleted together with their refs. This limitation is inherited from
the "files" backend, which may otherwise hit issues with directory/file
conflicts if it didn't delete reflogs.

Once that limitation is lifted for the "reftable" backend though, it
will become even more important to give users the tools to discover
reflogs that do not have a corresponding ref.

The series is structured as follows:

  - Patches 1-3 extend the dir iterator so that it can sort directory
    entries lexicographically. This is required such that we can list
    reflogs with deterministic ordering.

  - Patch 4 refactors the reflog iterator interface to demonstrate that
    the object ID and flags aren't needed nowadays, and patch 5 builds
    on top of that and stops resolving the refs altogether. This allows
    us to also surface reflogs of broken refs.

  - Patch 6 introduces the new subcommand.

The series depends on Junio's ps/reftable-backend at 8a0bebdeae
(refs/reftable: fix leak when copying reflog fails, 2024-02-08): the
change in behaviour in patches 4 and 5 apply to both backends.

Patrick

Patrick Steinhardt (6):
  dir-iterator: pass name to `prepare_next_entry_data()` directly
  dir-iterator: support iteration in sorted order
  refs/files: sort reflogs returned by the reflog iterator
  refs: drop unused params from the reflog iterator callback
  refs: stop resolving ref corresponding to reflogs
  builtin/reflog: introduce subcommand to list reflogs

 Documentation/git-reflog.txt   |  3 ++
 builtin/fsck.c                 |  4 +-
 builtin/reflog.c               | 37 +++++++++++++-
 dir-iterator.c                 | 93 ++++++++++++++++++++++++++--------
 dir-iterator.h                 |  3 ++
 refs.c                         | 23 +++++++--
 refs.h                         | 11 +++-
 refs/files-backend.c           | 22 ++------
 refs/reftable-backend.c        | 12 +----
 revision.c                     |  4 +-
 t/helper/test-ref-store.c      | 18 ++++---
 t/t0600-reffiles-backend.sh    | 24 ++++-----
 t/t1405-main-ref-store.sh      |  8 +--
 t/t1406-submodule-ref-store.sh |  8 +--
 t/t1410-reflog.sh              | 69 +++++++++++++++++++++++++
 15 files changed, 251 insertions(+), 88 deletions(-)

-- 
2.44.0-rc1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2024-02-19 14:35 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 14:35 Patrick Steinhardt [this message]
2024-02-19 14:35 ` [PATCH 1/6] dir-iterator: pass name to `prepare_next_entry_data()` directly Patrick Steinhardt
2024-02-19 14:35 ` [PATCH 2/6] dir-iterator: support iteration in sorted order Patrick Steinhardt
2024-02-19 23:39   ` Junio C Hamano
2024-02-20  8:34     ` Patrick Steinhardt
2024-02-19 14:35 ` [PATCH 3/6] refs/files: sort reflogs returned by the reflog iterator Patrick Steinhardt
2024-02-20  0:04   ` Junio C Hamano
2024-02-20  8:34     ` Patrick Steinhardt
2024-02-19 14:35 ` [PATCH 4/6] refs: drop unused params from the reflog iterator callback Patrick Steinhardt
2024-02-20  0:14   ` Junio C Hamano
2024-02-20  8:34     ` Patrick Steinhardt
2024-02-19 14:35 ` [PATCH 5/6] refs: stop resolving ref corresponding to reflogs Patrick Steinhardt
2024-02-20  0:14   ` Junio C Hamano
2024-02-20  8:34     ` Patrick Steinhardt
2024-02-19 14:35 ` [PATCH 6/6] builtin/reflog: introduce subcommand to list reflogs Patrick Steinhardt
2024-02-20  0:32   ` Junio C Hamano
2024-02-20  8:34     ` Patrick Steinhardt
2024-02-20  9:06 ` [PATCH v2 0/7] reflog: " Patrick Steinhardt
2024-02-20  9:06   ` [PATCH v2 1/7] dir-iterator: pass name to `prepare_next_entry_data()` directly Patrick Steinhardt
2024-02-20  9:06   ` [PATCH v2 2/7] dir-iterator: support iteration in sorted order Patrick Steinhardt
2024-02-20  9:06   ` [PATCH v2 3/7] refs/files: sort reflogs returned by the reflog iterator Patrick Steinhardt
2024-02-20  9:06   ` [PATCH v2 4/7] refs: always treat iterators as ordered Patrick Steinhardt
2024-02-20  9:06   ` [PATCH v2 5/7] refs: drop unused params from the reflog iterator callback Patrick Steinhardt
2024-02-20  9:06   ` [PATCH v2 6/7] refs: stop resolving ref corresponding to reflogs Patrick Steinhardt
2024-02-20  9:06   ` [PATCH v2 7/7] builtin/reflog: introduce subcommand to list reflogs Patrick Steinhardt
2024-04-24  7:30     ` Teng Long
2024-04-24  8:01       ` Patrick Steinhardt
2024-04-24 14:53         ` Junio C Hamano
2024-02-20 17:22   ` [PATCH v2 0/7] reflog: " Junio C Hamano
2024-02-21 11:48     ` Patrick Steinhardt
2024-02-21 12:37 ` [PATCH v3 0/8] " Patrick Steinhardt
2024-02-21 12:37   ` [PATCH v3 1/8] dir-iterator: pass name to `prepare_next_entry_data()` directly Patrick Steinhardt
2024-02-21 12:37   ` [PATCH v3 2/8] dir-iterator: support iteration in sorted order Patrick Steinhardt
2024-02-21 12:37   ` [PATCH v3 3/8] refs/files: sort reflogs returned by the reflog iterator Patrick Steinhardt
2024-02-21 12:37   ` [PATCH v3 4/8] refs/files: sort merged worktree and common reflogs Patrick Steinhardt
2024-02-21 12:37   ` [PATCH v3 5/8] refs: always treat iterators as ordered Patrick Steinhardt
2024-02-21 12:37   ` [PATCH v3 6/8] refs: drop unused params from the reflog iterator callback Patrick Steinhardt
2024-02-21 12:37   ` [PATCH v3 7/8] refs: stop resolving ref corresponding to reflogs Patrick Steinhardt
2024-02-21 12:37   ` [PATCH v3 8/8] builtin/reflog: introduce subcommand to list reflogs Patrick Steinhardt

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1708353264.git.ps@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).