All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rev-list: accept --format without argument
@ 2010-07-28  9:42 Matthieu Moy
  2010-07-28 16:04 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Matthieu Moy @ 2010-07-28  9:42 UTC (permalink / raw)
  To: git, gitster; +Cc: Matthieu Moy

The documentation says the syntax is --format[='<format>'], match it in
the implementation.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Not that it's terribly usefull, but better be consistant ...
 revision.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/revision.c b/revision.c
index 33fa0b5..4b64757 100644
--- a/revision.c
+++ b/revision.c
@@ -1300,10 +1300,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 		revs->combine_merges = 1;
 	} else if (!strcmp(arg, "-v")) {
 		revs->verbose_header = 1;
-	} else if (!strcmp(arg, "--pretty")) {
+	} else if (!strcmp(arg, "--pretty") || !strcmp(arg, "--format")) {
 		revs->verbose_header = 1;
 		revs->pretty_given = 1;
-		get_commit_format(arg+8, revs);
+		get_commit_format("", revs);
 	} else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) {
 		/*
 		 * Detached form ("--pretty X" as opposed to "--pretty=X")
-- 
1.7.2.25.g9ebe3

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

* Re: [PATCH] rev-list: accept --format without argument
  2010-07-28  9:42 [PATCH] rev-list: accept --format without argument Matthieu Moy
@ 2010-07-28 16:04 ` Junio C Hamano
  2010-07-28 16:29   ` Matthieu Moy
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2010-07-28 16:04 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

Matthieu Moy <Matthieu.Moy@imag.fr> writes:

> The documentation says the syntax is --format[='<format>'], match it in
> the implementation.
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
> Not that it's terribly usefull, but better be consistant ...

Hmm, I do not care too deeply either way as I do not expect anybody sane
to have used, nor learn from this patch and start using, --format without
any formatting specification, but it somehow feels that this patch takes
consistency the wrong way.

>  revision.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/revision.c b/revision.c
> index 33fa0b5..4b64757 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -1300,10 +1300,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
>  		revs->combine_merges = 1;
>  	} else if (!strcmp(arg, "-v")) {
>  		revs->verbose_header = 1;
> -	} else if (!strcmp(arg, "--pretty")) {
> +	} else if (!strcmp(arg, "--pretty") || !strcmp(arg, "--format")) {
>  		revs->verbose_header = 1;
>  		revs->pretty_given = 1;
> -		get_commit_format(arg+8, revs);
> +		get_commit_format("", revs);
>  	} else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) {
>  		/*
>  		 * Detached form ("--pretty X" as opposed to "--pretty=X")
> -- 
> 1.7.2.25.g9ebe3

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

* Re: [PATCH] rev-list: accept --format without argument
  2010-07-28 16:04 ` Junio C Hamano
@ 2010-07-28 16:29   ` Matthieu Moy
  2010-08-04  7:39     ` Matthieu Moy
  0 siblings, 1 reply; 5+ messages in thread
From: Matthieu Moy @ 2010-07-28 16:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> The documentation says the syntax is --format[='<format>'], match it in
>> the implementation.
>>
>> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
>> ---
>> Not that it's terribly usefull, but better be consistant ...
>
> Hmm, I do not care too deeply either way as I do not expect anybody sane
> to have used, nor learn from this patch and start using, --format without
> any formatting specification, but it somehow feels that this patch takes
> consistency the wrong way.

The other way would be stg like:

diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
index d78e121..9b6f389 100644
--- a/Documentation/pretty-options.txt
+++ b/Documentation/pretty-options.txt
@@ -1,5 +1,5 @@
 --pretty[='<format>']::
---format[='<format>']::
+--format='<format>'::
 
        Pretty-print the contents of the commit logs in a given format,
        where '<format>' can be one of 'oneline', 'short', 'medium',

But I'd say it's simpler to be able to say "--format is an alias for
--pretty" than "--format is an alias for --pretty _except that ..._".

And actually,

git rev-list --format

is not that stupid if you read it as "list revisions and do some
formatting as you do it".

(but I don't care much either ;-) )

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

* Re: [PATCH] rev-list: accept --format without argument
  2010-07-28 16:29   ` Matthieu Moy
@ 2010-08-04  7:39     ` Matthieu Moy
  2010-08-04 18:14       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Matthieu Moy @ 2010-08-04  7:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Any other thought on this? I don't care much either way, but we should
make the doc and the implementation consistant anyway...

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> Junio C Hamano <gitster@pobox.com> writes:
>
>> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>>
>>> The documentation says the syntax is --format[='<format>'], match it in
>>> the implementation.
>>>
>>> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
>>> ---
>>> Not that it's terribly usefull, but better be consistant ...
>>
>> Hmm, I do not care too deeply either way as I do not expect anybody sane
>> to have used, nor learn from this patch and start using, --format without
>> any formatting specification, but it somehow feels that this patch takes
>> consistency the wrong way.
>
> The other way would be stg like:
>
> diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
> index d78e121..9b6f389 100644
> --- a/Documentation/pretty-options.txt
> +++ b/Documentation/pretty-options.txt
> @@ -1,5 +1,5 @@
>  --pretty[='<format>']::
> ---format[='<format>']::
> +--format='<format>'::
>  
>         Pretty-print the contents of the commit logs in a given format,
>         where '<format>' can be one of 'oneline', 'short', 'medium',
>
> But I'd say it's simpler to be able to say "--format is an alias for
> --pretty" than "--format is an alias for --pretty _except that ..._".
>
> And actually,
>
> git rev-list --format
>
> is not that stupid if you read it as "list revisions and do some
> formatting as you do it".
>
> (but I don't care much either ;-) )

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

* Re: [PATCH] rev-list: accept --format without argument
  2010-08-04  7:39     ` Matthieu Moy
@ 2010-08-04 18:14       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2010-08-04 18:14 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> Any other thought on this?

Not really, at least from me.

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

end of thread, other threads:[~2010-08-04 18:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-28  9:42 [PATCH] rev-list: accept --format without argument Matthieu Moy
2010-07-28 16:04 ` Junio C Hamano
2010-07-28 16:29   ` Matthieu Moy
2010-08-04  7:39     ` Matthieu Moy
2010-08-04 18:14       ` Junio C Hamano

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.