prune: allow --dry-run for -n and --verbose for -v
PATCH 1/1 prune: allow --dry-run for -n and --verbose for -v
For consistency with other git commands, let git prune accept the long options --dry-run and --verbose for the respective short ones -n and -v.
--- Documentation/git-prune.txt | 2 ++ builtin/prune.c | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-)
Documentation/git-prune.txt +2 -0
@@ -31,10 +31,12 @@ OPTIONS ------- -n:: +--dry-run:: Do not remove anything; just report what it would remove. -v:: +--verbose:: Report all removed objects. \--::
builtin/prune.c +2 -3
@@ -125,10 +125,9 @@ int cmd_prune(int argc, const char **argv, const char *prefix) {struct rev_info revs;const struct option options[] = { -OPT_BOOLEAN ('n' ,NULL , &show_only, +OPT_BOOLEAN ('n' ,"dry-run" , &show_only,"do not remove, show only" ), -OPT_BOOLEAN ('v' ,NULL , &verbose, -"report pruned objects" ), +OPT_BOOLEAN ('v' ,"verbose" , &verbose,"report pruned objects" ),OPT_DATE (0 ,"expire" , &expire,"expire objects older than <time>" ),OPT_END ()
Signature · 1 line
1.7.2
builtin/prune.c int cmd_prune(int argc, const char **argv, const char *prefix) · line 128
Quoted 7 lines · René Scharfe
+++
b/builtin/prune.cbuiltin/prune.c +1
-1@@ -125,10 +125,9 @@ int cmd_prune(int argc, const char **argv, const char *prefix) { struct rev_info revs; const struct option options[] = { - OPT_BOOLEAN('n', NULL, &show_only, + OPT_BOOLEAN('n', "dry-run", &show_only,
For the curious: avoiding OPT__DRY_RUN allows us to give a better description:
builtin/prune.c int cmd_prune(int argc, const char **argv, const char *prefix) · line 129
Quoted 1 line
builtin/prune.c +0
-0"do not remove, show only"),
which makes sense to me. Thanks.
Am 06.08.2010 23:04, schrieb Jonathan Nieder:
Quoted 13 lines
builtin/prune.c int cmd_prune(int argc, const char **argv, const char *prefix) · line 128
Quoted 7 lines · René Scharfe
+++
b/builtin/prune.cbuiltin/prune.c +1
-1@@ -125,10 +125,9 @@ int cmd_prune(int argc, const char **argv, const char *prefix) { struct rev_info revs; const struct option options[] = { - OPT_BOOLEAN('n', NULL, &show_only, + OPT_BOOLEAN('n', "dry-run", &show_only,For the curious: avoiding
OPT__DRY_RUNallows us to give a better description:
Quoted 3 lines
builtin/prune.c int cmd_prune(int argc, const char **argv, const char *prefix) · line 129
Quoted 1 line
builtin/prune.c +0
-0"do not remove, show only"),which makes sense to me. Thanks.
Indeed.
Adding a helptext parameter to OPT__DRY_RUN à la OPT__COLOR would make it usable here as well as in commit.c and fetch.c. Similar changes could help OPT__VERBOSE and OPT__QUIET. Their standard helptexts don't add a lot of information..
René
Am 06.08.2010 23:41, schrieb René Scharfe:
Quoted 2 lines
Adding a helptext parameter to
OPT__DRY_RUNà laOPT__COLORwould make it usable here as well as incommit.candfetch.c.
Actually it doesn't, because the short option -n is used for other purposes there. But I still think it's worth doing because the description can then be made more meaningful instead while now it's just repeating the long option.
René