{"thread":{"id":"24551","subject":"[PATCH] rev-list: accept --format without argument","startedAt":"2010-07-28T09:42:00Z","lastAt":"2010-08-04T18:14:22Z","messageCount":5,"participants":["Matthieu Moy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"146602","messageId":"1280310120-16852-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"24551","inReplyTo":null,"subject":"[PATCH] rev-list: accept --format without argument","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2010-07-28T09:42:00Z","receivedAt":"2010-07-28T09:42:00Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The documentation says the syntax is --format[='<format>'], match it in\nthe implementation.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nNot that it's terribly usefull, but better be consistant ...\n revision.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/revision.c b/revision.c\nindex 33fa0b5..4b64757 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1300,10 +1300,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t\trevs->combine_merges = 1;\n \t} else if (!strcmp(arg, \"-v\")) {\n \t\trevs->verbose_header = 1;\n-\t} else if (!strcmp(arg, \"--pretty\")) {\n+\t} else if (!strcmp(arg, \"--pretty\") || !strcmp(arg, \"--format\")) {\n \t\trevs->verbose_header = 1;\n \t\trevs->pretty_given = 1;\n-\t\tget_commit_format(arg+8, revs);\n+\t\tget_commit_format(\"\", revs);\n \t} else if (!prefixcmp(arg, \"--pretty=\") || !prefixcmp(arg, \"--format=\")) {\n \t\t/*\n \t\t * Detached form (\"--pretty X\" as opposed to \"--pretty=X\")\n-- \n1.7.2.25.g9ebe3\n"},{"id":"146632","messageId":"7vlj8v7ftw.fsf@alter.siamese.dyndns.org","threadId":"24551","inReplyTo":"1280310120-16852-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] rev-list: accept --format without argument","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-28T16:04:43Z","receivedAt":"2010-07-28T16:04:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> The documentation says the syntax is --format[='<format>'], match it in\n> the implementation.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n> Not that it's terribly usefull, but better be consistant ...\n\nHmm, I do not care too deeply either way as I do not expect anybody sane\nto have used, nor learn from this patch and start using, --format without\nany formatting specification, but it somehow feels that this patch takes\nconsistency the wrong way.\n\n>  revision.c |    4 ++--\n>  1 files changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/revision.c b/revision.c\n> index 33fa0b5..4b64757 100644\n> --- a/revision.c\n> +++ b/revision.c\n> @@ -1300,10 +1300,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n>  \t\trevs->combine_merges = 1;\n>  \t} else if (!strcmp(arg, \"-v\")) {\n>  \t\trevs->verbose_header = 1;\n> -\t} else if (!strcmp(arg, \"--pretty\")) {\n> +\t} else if (!strcmp(arg, \"--pretty\") || !strcmp(arg, \"--format\")) {\n>  \t\trevs->verbose_header = 1;\n>  \t\trevs->pretty_given = 1;\n> -\t\tget_commit_format(arg+8, revs);\n> +\t\tget_commit_format(\"\", revs);\n>  \t} else if (!prefixcmp(arg, \"--pretty=\") || !prefixcmp(arg, \"--format=\")) {\n>  \t\t/*\n>  \t\t * Detached form (\"--pretty X\" as opposed to \"--pretty=X\")\n> -- \n> 1.7.2.25.g9ebe3\n"},{"id":"146634","messageId":"vpqy6cvwovv.fsf@bauges.imag.fr","threadId":"24551","inReplyTo":"7vlj8v7ftw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] rev-list: accept --format without argument","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-07-28T16:29:56Z","receivedAt":"2010-07-28T16:29:56Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>\n>> The documentation says the syntax is --format[='<format>'], match it in\n>> the implementation.\n>>\n>> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n>> ---\n>> Not that it's terribly usefull, but better be consistant ...\n>\n> Hmm, I do not care too deeply either way as I do not expect anybody sane\n> to have used, nor learn from this patch and start using, --format without\n> any formatting specification, but it somehow feels that this patch takes\n> consistency the wrong way.\n\nThe other way would be stg like:\n\ndiff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt\nindex d78e121..9b6f389 100644\n--- a/Documentation/pretty-options.txt\n+++ b/Documentation/pretty-options.txt\n@@ -1,5 +1,5 @@\n --pretty[='<format>']::\n---format[='<format>']::\n+--format='<format>'::\n \n        Pretty-print the contents of the commit logs in a given format,\n        where '<format>' can be one of 'oneline', 'short', 'medium',\n\nBut I'd say it's simpler to be able to say \"--format is an alias for\n--pretty\" than \"--format is an alias for --pretty _except that ..._\".\n\nAnd actually,\n\ngit rev-list --format\n\nis not that stupid if you read it as \"list revisions and do some\nformatting as you do it\".\n\n(but I don't care much either ;-) )\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"147096","messageId":"vpqocdiltck.fsf@bauges.imag.fr","threadId":"24551","inReplyTo":"vpqy6cvwovv.fsf@bauges.imag.fr","subject":"Re: [PATCH] rev-list: accept --format without argument","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-08-04T07:39:23Z","receivedAt":"2010-08-04T07:39:23Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Any other thought on this? I don't care much either way, but we should\nmake the doc and the implementation consistant anyway...\n\nMatthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>>\n>>> The documentation says the syntax is --format[='<format>'], match it in\n>>> the implementation.\n>>>\n>>> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n>>> ---\n>>> Not that it's terribly usefull, but better be consistant ...\n>>\n>> Hmm, I do not care too deeply either way as I do not expect anybody sane\n>> to have used, nor learn from this patch and start using, --format without\n>> any formatting specification, but it somehow feels that this patch takes\n>> consistency the wrong way.\n>\n> The other way would be stg like:\n>\n> diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt\n> index d78e121..9b6f389 100644\n> --- a/Documentation/pretty-options.txt\n> +++ b/Documentation/pretty-options.txt\n> @@ -1,5 +1,5 @@\n>  --pretty[='<format>']::\n> ---format[='<format>']::\n> +--format='<format>'::\n>  \n>         Pretty-print the contents of the commit logs in a given format,\n>         where '<format>' can be one of 'oneline', 'short', 'medium',\n>\n> But I'd say it's simpler to be able to say \"--format is an alias for\n> --pretty\" than \"--format is an alias for --pretty _except that ..._\".\n>\n> And actually,\n>\n> git rev-list --format\n>\n> is not that stupid if you read it as \"list revisions and do some\n> formatting as you do it\".\n>\n> (but I don't care much either ;-) )\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"147122","messageId":"7vk4o6fdoh.fsf@alter.siamese.dyndns.org","threadId":"24551","inReplyTo":"vpqocdiltck.fsf@bauges.imag.fr","subject":"Re: [PATCH] rev-list: accept --format without argument","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-08-04T18:14:22Z","receivedAt":"2010-08-04T18:14:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Any other thought on this?\n\nNot really, at least from me.\n"}]}