From d699d15c328b03fd822d3950f7ed76debef02c26 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 21 Feb 2024 13:37:47 +0100 Subject: [PATCH] builtin/reflog: introduce subcommand to list reflogs While the git-reflog(1) command has subcommands to show reflog entries or check for reflog existence, it does not have any subcommands that would allow the user to enumerate all existing reflogs. This makes it quite hard to discover which reflogs a repository has. While this can be worked around with the "files" backend by enumerating files in the ".git/logs" directory, users of the "reftable" backend don't enjoy such a luxury. Introduce a new subcommand `git reflog list` that lists all reflogs the repository knows of to fill this gap. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- Documentation/git-reflog.txt | 3 + builtin/reflog.c | 34 +++++++++++ t/t1410-reflog.sh | 108 +++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+) diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt index ec64cbff4c..a929c52982 100644 --- a/Documentation/git-reflog.txt +++ b/Documentation/git-reflog.txt @@ -10,6 +10,7 @@ SYNOPSIS -------- [verse] 'git reflog' [show] [] [] +'git reflog list' 'git reflog expire' [--expire=