{"thread":{"id":"60559","subject":"[PATCH] builtin/reflog.c: fix dry-run option short name","startedAt":"2023-11-26T00:24:02Z","lastAt":"2023-11-26T08:44:41Z","messageCount":2,"participants":["Josh Brobst","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"485148","messageId":"20231126000514.85509-1-josh@brob.st","threadId":"60559","inReplyTo":null,"subject":"[PATCH] builtin/reflog.c: fix dry-run option short name","fromName":"Josh Brobst","fromEmail":"josh@brob.st","sentAt":"2023-11-26T00:05:14Z","receivedAt":"2023-11-26T00:24:02Z","isPatch":true,"sender":{"key":"josh@brob.st","avatar":null},"body":"The documentation for reflog states that the --dry-run option of the\nexpire and delete subcommands has a corresponding short name, -n.\nHowever, 33d7bdd645 (builtin/reflog.c: use parse-options api for expire,\ndelete subcommands, 2022-01-06) did not include this short name in the\nnew options parsing.\n\nRe-add the short name in the new dry-run option definitions.\n\nSigned-off-by: Josh Brobst <josh@brob.st>\n---\n builtin/reflog.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/reflog.c b/builtin/reflog.c\nindex df63a5892e..a39962df69 100644\n--- a/builtin/reflog.c\n+++ b/builtin/reflog.c\n@@ -248,7 +248,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)\n \tint verbose = 0;\n \treflog_expiry_should_prune_fn *should_prune_fn = should_expire_reflog_ent;\n \tconst struct option options[] = {\n-\t\tOPT_BIT(0, \"dry-run\", &flags, N_(\"do not actually prune any entries\"),\n+\t\tOPT_BIT('n', \"dry-run\", &flags, N_(\"do not actually prune any entries\"),\n \t\t\tEXPIRE_REFLOGS_DRY_RUN),\n \t\tOPT_BIT(0, \"rewrite\", &flags,\n \t\t\tN_(\"rewrite the old SHA1 with the new SHA1 of the entry that now precedes it\"),\n@@ -368,7 +368,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)\n \tint verbose = 0;\n \n \tconst struct option options[] = {\n-\t\tOPT_BIT(0, \"dry-run\", &flags, N_(\"do not actually prune any entries\"),\n+\t\tOPT_BIT('n', \"dry-run\", &flags, N_(\"do not actually prune any entries\"),\n \t\t\tEXPIRE_REFLOGS_DRY_RUN),\n \t\tOPT_BIT(0, \"rewrite\", &flags,\n \t\t\tN_(\"rewrite the old SHA1 with the new SHA1 of the entry that now precedes it\"),\n-- \n2.42.0\n\n"},{"id":"485156","messageId":"xmqqleak6gzy.fsf@gitster.g","threadId":"60559","inReplyTo":"20231126000514.85509-1-josh@brob.st","subject":"Re: [PATCH] builtin/reflog.c: fix dry-run option short name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-11-26T08:44:33Z","receivedAt":"2023-11-26T08:44:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josh Brobst <josh@brob.st> writes:\n\n> The documentation for reflog states that the --dry-run option of the\n> expire and delete subcommands has a corresponding short name, -n.\n> However, 33d7bdd645 (builtin/reflog.c: use parse-options api for expire,\n> delete subcommands, 2022-01-06) did not include this short name in the\n> new options parsing.\n>\n> Re-add the short name in the new dry-run option definitions.\n\nPerfect.  Thanks for spotting and doing necessary archaeology.\n"}]}