git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] rev-list: accept --format without argument

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 28, 2010, 16:04 UTC
Message-ID
<7vlj8v7ftw.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1280310120-16852-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 6 quoted lines
> 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.

Show 22 quoted lines
>  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
Previous: Matthieu MoyNext: Matthieu Moy
Message 2 of 5 in “rev-list: accept --format without argument”
  1. rev-list: accept --format without argumentMatthieu Moy, Jul 28, 2010
  2. Junio C HamanoJul 28, 2010
  3. Matthieu MoyJul 28, 2010
  4. Matthieu MoyAug 4, 2010
  5. Junio C HamanoAug 4, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.