{"thread":{"id":"13665","subject":"[PATCH] log --pretty: do not accept bogus \"--prettyshort\"","startedAt":"2008-05-26T03:19:30Z","lastAt":"2008-05-26T10:05:51Z","messageCount":2,"participants":["Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"77736","messageId":"7vy75xeoql.fsf@gitster.siamese.dyndns.org","threadId":"13665","inReplyTo":null,"subject":"[PATCH] log --pretty: do not accept bogus \"--prettyshort\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-26T03:19:30Z","receivedAt":"2008-05-26T03:19:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"... nor bogus \"format.pretty = '=short'\".  Both are syntax errors.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n * This lazy parsing was introduced by 6cdfd17 (commit: allow --pretty=\n   args to be abbreviated, 2006-05-14), more than a year ago...\n\n pretty.c   |    2 --\n revision.c |    7 ++++++-\n 2 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/pretty.c b/pretty.c\nindex 6872932..8eb39e9 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -28,8 +28,6 @@ void get_commit_format(const char *arg, struct rev_info *rev)\n \t\trev->commit_format = CMIT_FMT_DEFAULT;\n \t\treturn;\n \t}\n-\tif (*arg == '=')\n-\t\targ++;\n \tif (!prefixcmp(arg, \"format:\") || !prefixcmp(arg, \"tformat:\")) {\n \t\tconst char *cp = strchr(arg, ':') + 1;\n \t\tfree(user_format);\ndiff --git a/revision.c b/revision.c\nindex ac057e1..fc66755 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1197,11 +1197,16 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch\n \t\t\t\trevs->verbose_header = 1;\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tif (!prefixcmp(arg, \"--pretty\")) {\n+\t\t\tif (!strcmp(arg, \"--pretty\")) {\n \t\t\t\trevs->verbose_header = 1;\n \t\t\t\tget_commit_format(arg+8, revs);\n \t\t\t\tcontinue;\n \t\t\t}\n+\t\t\tif (!prefixcmp(arg, \"--pretty=\")) {\n+\t\t\t\trevs->verbose_header = 1;\n+\t\t\t\tget_commit_format(arg+9, revs);\n+\t\t\t\tcontinue;\n+\t\t\t}\n \t\t\tif (!strcmp(arg, \"--graph\")) {\n \t\t\t\trevs->topo_order = 1;\n \t\t\t\trevs->rewrite_parents = 1;\n-- \n1.5.5.1.467.g9bd81\n"},{"id":"77754","messageId":"alpine.DEB.1.00.0805261105090.30431@racer","threadId":"13665","inReplyTo":"7vy75xeoql.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] log --pretty: do not accept bogus \"--prettyshort\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-26T10:05:51Z","receivedAt":"2008-05-26T10:05:51Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 25 May 2008, Junio C Hamano wrote:\n\n> diff --git a/revision.c b/revision.c\n> index ac057e1..fc66755 100644\n> --- a/revision.c\n> +++ b/revision.c\n> @@ -1197,11 +1197,16 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch\n>  \t\t\t\trevs->verbose_header = 1;\n>  \t\t\t\tcontinue;\n>  \t\t\t}\n> -\t\t\tif (!prefixcmp(arg, \"--pretty\")) {\n> +\t\t\tif (!strcmp(arg, \"--pretty\")) {\n>  \t\t\t\trevs->verbose_header = 1;\n>  \t\t\t\tget_commit_format(arg+8, revs);\n\nDoes \"args+8\" really make sense, still?  Okay, it is the same as \"\", but \nthe latter would not make me go \"Hum?!\".\n\nCiao,\nDscho\n"}]}