* [PATCH] builtin/reflog.c: fix dry-run option short name
@ 2023-11-26 0:05 Josh Brobst
2023-11-26 8:44 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Josh Brobst @ 2023-11-26 0:05 UTC (permalink / raw)
To: git; +Cc: Josh Brobst
The documentation for reflog states that the --dry-run option of the
expire and delete subcommands has a corresponding short name, -n.
However, 33d7bdd645 (builtin/reflog.c: use parse-options api for expire,
delete subcommands, 2022-01-06) did not include this short name in the
new options parsing.
Re-add the short name in the new dry-run option definitions.
Signed-off-by: Josh Brobst <josh@brob.st>
---
builtin/reflog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/reflog.c b/builtin/reflog.c
index df63a5892e..a39962df69 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -248,7 +248,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
int verbose = 0;
reflog_expiry_should_prune_fn *should_prune_fn = should_expire_reflog_ent;
const struct option options[] = {
- OPT_BIT(0, "dry-run", &flags, N_("do not actually prune any entries"),
+ OPT_BIT('n', "dry-run", &flags, N_("do not actually prune any entries"),
EXPIRE_REFLOGS_DRY_RUN),
OPT_BIT(0, "rewrite", &flags,
N_("rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"),
@@ -368,7 +368,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
int verbose = 0;
const struct option options[] = {
- OPT_BIT(0, "dry-run", &flags, N_("do not actually prune any entries"),
+ OPT_BIT('n', "dry-run", &flags, N_("do not actually prune any entries"),
EXPIRE_REFLOGS_DRY_RUN),
OPT_BIT(0, "rewrite", &flags,
N_("rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"),
--
2.42.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] builtin/reflog.c: fix dry-run option short name
2023-11-26 0:05 [PATCH] builtin/reflog.c: fix dry-run option short name Josh Brobst
@ 2023-11-26 8:44 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2023-11-26 8:44 UTC (permalink / raw)
To: Josh Brobst; +Cc: git
Josh Brobst <josh@brob.st> writes:
> The documentation for reflog states that the --dry-run option of the
> expire and delete subcommands has a corresponding short name, -n.
> However, 33d7bdd645 (builtin/reflog.c: use parse-options api for expire,
> delete subcommands, 2022-01-06) did not include this short name in the
> new options parsing.
>
> Re-add the short name in the new dry-run option definitions.
Perfect. Thanks for spotting and doing necessary archaeology.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-26 8:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-26 0:05 [PATCH] builtin/reflog.c: fix dry-run option short name Josh Brobst
2023-11-26 8:44 ` Junio C Hamano
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 NNTP newsgroup(s).