aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-08-06 07:54:13 +0200
committerJunio C Hamano <gitster@pobox.com>2025-08-06 07:36:29 -0700
commit649c7bb77a173c6ef2c27fc64b8689aee9b0b8a8 (patch)
tree5c2e8a21bbb5e1e233ae5bad7397af50c223d6c0 /Documentation
parente9493c55af074fb7179922fafa61104332c05cc9 (diff)
downloadgit-649c7bb77a173c6ef2c27fc64b8689aee9b0b8a8.tar.gz
builtin/reflog: improve grouping of subcommands
The way subcommands of git-reflog(1) are laid out does not make any immediate sense. Reorder them such that read-only subcommands precede writing commands for a bit more structure. Furthermore, move the "expire" subcommand last. This prepares for a subsequent change where we are about to introduce a new "write" command to append reflog entries. Like this, the writing subcommands are ordered such that those affecting a single reflog come before those spanning across all reflogs. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-reflog.adoc61
1 files changed, 31 insertions, 30 deletions
diff --git a/Documentation/git-reflog.adoc b/Documentation/git-reflog.adoc
index 0d6601fdea..4eb6c25607 100644
--- a/Documentation/git-reflog.adoc
+++ b/Documentation/git-reflog.adoc
@@ -11,13 +11,13 @@ SYNOPSIS
[synopsis]
git reflog [show] [<log-options>] [<ref>]
git reflog list
-git reflog expire [--expire=<time>] [--expire-unreachable=<time>]
- [--rewrite] [--updateref] [--stale-fix]
- [--dry-run | -n] [--verbose] [--all [--single-worktree] | <refs>...]
+git reflog exists <ref>
git reflog delete [--rewrite] [--updateref]
[--dry-run | -n] [--verbose] <ref>@{<specifier>}...
git reflog drop [--all [--single-worktree] | <refs>...]
-git reflog exists <ref>
+git reflog expire [--expire=<time>] [--expire-unreachable=<time>]
+ [--rewrite] [--updateref] [--stale-fix]
+ [--dry-run | -n] [--verbose] [--all [--single-worktree] | <refs>...]
DESCRIPTION
-----------
@@ -43,11 +43,9 @@ actions, and in addition the `HEAD` reflog records branch switching.
The "list" subcommand lists all refs which have a corresponding reflog.
-The "expire" subcommand prunes older reflog entries. Entries older
-than `expire` time, or entries older than `expire-unreachable` time
-and not reachable from the current tip, are removed from the reflog.
-This is typically not used directly by end users -- instead, see
-linkgit:git-gc[1].
+The "exists" subcommand checks whether a ref has a reflog. It exits
+with zero status if the reflog exists, and non-zero status if it does
+not.
The "delete" subcommand deletes single entries from the reflog, but
not the reflog itself. Its argument must be an _exact_ entry (e.g. "`git
@@ -58,9 +56,11 @@ The "drop" subcommand completely removes the reflog for the specified
references. This is in contrast to "expire" and "delete", both of which
can be used to delete reflog entries, but not the reflog itself.
-The "exists" subcommand checks whether a ref has a reflog. It exits
-with zero status if the reflog exists, and non-zero status if it does
-not.
+The "expire" subcommand prunes older reflog entries. Entries older
+than `expire` time, or entries older than `expire-unreachable` time
+and not reachable from the current tip, are removed from the reflog.
+This is typically not used directly by end users -- instead, see
+linkgit:git-gc[1].
OPTIONS
-------
@@ -71,6 +71,25 @@ Options for `show`
`git reflog show` accepts any of the options accepted by `git log`.
+Options for `delete`
+~~~~~~~~~~~~~~~~~~~~
+
+`git reflog delete` accepts options `--updateref`, `--rewrite`, `-n`,
+`--dry-run`, and `--verbose`, with the same meanings as when they are
+used with `expire`.
+
+Options for `drop`
+~~~~~~~~~~~~~~~~~~
+
+`--all`::
+ Drop the reflogs of all references from all worktrees.
+
+`--single-worktree`::
+ By default when `--all` is specified, reflogs from all working
+ trees are dropped. This option limits the processing to reflogs
+ from the current working tree only.
+
+
Options for `expire`
~~~~~~~~~~~~~~~~~~~~
@@ -130,24 +149,6 @@ which didn't protect objects referred to by reflogs.
Print extra information on screen.
-Options for `delete`
-~~~~~~~~~~~~~~~~~~~~
-
-`git reflog delete` accepts options `--updateref`, `--rewrite`, `-n`,
-`--dry-run`, and `--verbose`, with the same meanings as when they are
-used with `expire`.
-
-Options for `drop`
-~~~~~~~~~~~~~~~~~~
-
-`--all`::
- Drop the reflogs of all references from all worktrees.
-
-`--single-worktree`::
- By default when `--all` is specified, reflogs from all working
- trees are dropped. This option limits the processing to reflogs
- from the current working tree only.
-
GIT
---
Part of the linkgit:git[1] suite