All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] prune: allow --dry-run for -n and --verbose for -v
@ 2010-08-06 20:28 René Scharfe
  2010-08-06 21:04 ` Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: René Scharfe @ 2010-08-06 20:28 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano

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.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 Documentation/git-prune.txt |    2 ++
 builtin/prune.c             |    5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt
index 15cfb7a..4d673a5 100644
--- a/Documentation/git-prune.txt
+++ b/Documentation/git-prune.txt
@@ -31,10 +31,12 @@ OPTIONS
 -------
 
 -n::
+--dry-run::
 	Do not remove anything; just report what it would
 	remove.
 
 -v::
+--verbose::
 	Report all removed objects.
 
 \--::
diff --git a/builtin/prune.c b/builtin/prune.c
index 81f915ec..99218ba 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -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()
-- 
1.7.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] prune: allow --dry-run for -n and --verbose for -v
  2010-08-06 20:28 [PATCH] prune: allow --dry-run for -n and --verbose for -v René Scharfe
@ 2010-08-06 21:04 ` Jonathan Nieder
  2010-08-06 21:41   ` René Scharfe
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Nieder @ 2010-08-06 21:04 UTC (permalink / raw)
  To: René Scharfe; +Cc: Git Mailing List, Junio C Hamano

René Scharfe wrote:

> +++ b/builtin/prune.c
> @@ -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:

>  			    "do not remove, show only"),

which makes sense to me.  Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] prune: allow --dry-run for -n and --verbose for -v
  2010-08-06 21:04 ` Jonathan Nieder
@ 2010-08-06 21:41   ` René Scharfe
  2010-08-07  8:25     ` René Scharfe
  0 siblings, 1 reply; 4+ messages in thread
From: René Scharfe @ 2010-08-06 21:41 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Git Mailing List, Junio C Hamano

Am 06.08.2010 23:04, schrieb Jonathan Nieder:
> René Scharfe wrote:
>
>> +++ b/builtin/prune.c
>> @@ -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:
>
>>   			"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é

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] prune: allow --dry-run for -n and --verbose for -v
  2010-08-06 21:41   ` René Scharfe
@ 2010-08-07  8:25     ` René Scharfe
  0 siblings, 0 replies; 4+ messages in thread
From: René Scharfe @ 2010-08-07  8:25 UTC (permalink / raw)
  Cc: Jonathan Nieder, Git Mailing List, Junio C Hamano

Am 06.08.2010 23:41, schrieb René Scharfe:
> 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.

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é

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-07 12:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-06 20:28 [PATCH] prune: allow --dry-run for -n and --verbose for -v René Scharfe
2010-08-06 21:04 ` Jonathan Nieder
2010-08-06 21:41   ` René Scharfe
2010-08-07  8:25     ` René Scharfe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.