{"thread":{"id":"2421","subject":"[PATCH] Add --pretty=fuller","startedAt":"2005-11-10T06:16:34Z","lastAt":"2005-11-10T09:11:25Z","messageCount":3,"participants":["Junio C Hamano","Johannes Schindelin","Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11455","messageId":"7vzmod58ot.fsf@assigned-by-dhcp.cox.net","threadId":"2421","inReplyTo":null,"subject":"[PATCH] Add --pretty=fuller","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-10T06:16:34Z","receivedAt":"2005-11-10T06:16:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"git log without --pretty showed author and author-date, while\nwith --pretty=full showed author and committer but no dates.\nThe new formatting option, --pretty=fuller, shows both name and\ntimestamp for author and committer.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n * again, likes, dislikes, don't-cares?\n\n commit.c |   37 ++++++++++++++++++++++++++++++-------\n commit.h |    1 +\n 2 files changed, 31 insertions(+), 7 deletions(-)\n\napplies-to: 6466c53ae80cddbb581c5fdb2332f9321fade867\n2155be5980310bac027d4719458e9f5d5975c334\ndiff --git a/commit.c b/commit.c\nindex a8c9bfc..534c03e 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -34,6 +34,8 @@ enum cmit_fmt get_commit_format(const ch\n \t\treturn CMIT_FMT_SHORT;\n \tif (!strcmp(arg, \"=full\"))\n \t\treturn CMIT_FMT_FULL;\n+\tif (!strcmp(arg, \"=fuller\"))\n+\t\treturn CMIT_FMT_FULLER;\n \tif (!strcmp(arg, \"=oneline\"))\n \t\treturn CMIT_FMT_ONELINE;\n \tdie(\"invalid --pretty format\");\n@@ -361,6 +363,7 @@ static int add_user_info(const char *wha\n \tint namelen;\n \tunsigned long time;\n \tint tz, ret;\n+\tconst char *filler = \"    \";\n \n \tif (fmt == CMIT_FMT_ONELINE)\n \t\treturn 0;\n@@ -371,9 +374,20 @@ static int add_user_info(const char *wha\n \ttime = strtoul(date, &date, 10);\n \ttz = strtol(date, NULL, 10);\n \n-\tret = sprintf(buf, \"%s: %.*s\\n\", what, namelen, line);\n-\tif (fmt == CMIT_FMT_MEDIUM)\n+\tret = sprintf(buf, \"%s: %.*s%.*s\\n\", what,\n+\t\t      (fmt == CMIT_FMT_FULLER) ? 4 : 0,\n+\t\t      filler, namelen, line);\n+\tswitch (fmt) {\n+\tcase CMIT_FMT_MEDIUM:\n \t\tret += sprintf(buf + ret, \"Date:   %s\\n\", show_date(time, tz));\n+\t\tbreak;\n+\tcase CMIT_FMT_FULLER:\n+\t\tret += sprintf(buf + ret, \"%sDate: %s\\n\", what, show_date(time, tz));\n+\t\tbreak;\n+\tdefault:\n+\t\t/* notin' */\n+\t\tbreak;\n+\t}\n \treturn ret;\n }\n \n@@ -448,12 +462,21 @@ unsigned long pretty_print_commit(enum c\n \t\t\t\t\tdie(\"bad parent line in commit\");\n \t\t\t\toffset += add_parent_info(fmt, buf + offset, line, ++parents);\n \t\t\t}\n+\n+\t\t\t/*\n+\t\t\t * MEDIUM == DEFAULT shows only author with dates.\n+\t\t\t * FULL shows both authors but not dates.\n+\t\t\t * FULLER shows both authors and dates.\n+\t\t\t */\n \t\t\tif (!memcmp(line, \"author \", 7))\n-\t\t\t\toffset += add_user_info(\"Author\", fmt, buf + offset, line + 7);\n-\t\t\tif (fmt == CMIT_FMT_FULL) {\n-\t\t\t\tif (!memcmp(line, \"committer \", 10))\n-\t\t\t\t\toffset += add_user_info(\"Commit\", fmt, buf + offset, line + 10);\n-\t\t\t}\n+\t\t\t\toffset += add_user_info(\"Author\", fmt,\n+\t\t\t\t\t\t\tbuf + offset,\n+\t\t\t\t\t\t\tline + 7);\n+\t\t\tif (!memcmp(line, \"committer \", 10) &&\n+\t\t\t    (fmt == CMIT_FMT_FULL || fmt == CMIT_FMT_FULLER))\n+\t\t\t\toffset += add_user_info(\"Commit\", fmt,\n+\t\t\t\t\t\t\tbuf + offset,\n+\t\t\t\t\t\t\tline + 10);\n \t\t\tcontinue;\n \t\t}\n \ndiff --git a/commit.h b/commit.h\nindex 30702ca..6738a69 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -43,6 +43,7 @@ enum cmit_fmt {\n \tCMIT_FMT_DEFAULT = CMIT_FMT_MEDIUM,\n \tCMIT_FMT_SHORT,\n \tCMIT_FMT_FULL,\n+\tCMIT_FMT_FULLER,\n \tCMIT_FMT_ONELINE,\n };\n \n---\n0.99.9.GIT\n"},{"id":"11461","messageId":"Pine.LNX.4.63.0511100950290.3554@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2421","inReplyTo":"7vzmod58ot.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add --pretty=fuller","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-10T08:51:08Z","receivedAt":"2005-11-10T08:51:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 9 Nov 2005, Junio C Hamano wrote:\n\n>  * again, likes, dislikes, don't-cares?\n\nmelikes.\n\nOn a side note: what would --pretty=fullest contain? ;-)\n\nCiao,\nDscho\n"},{"id":"11463","messageId":"43730EBD.90307@op5.se","threadId":"2421","inReplyTo":"7vzmod58ot.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add --pretty=fuller","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-10T09:11:25Z","receivedAt":"2005-11-10T09:11:25Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> git log without --pretty showed author and author-date, while\n> with --pretty=full showed author and committer but no dates.\n> The new formatting option, --pretty=fuller, shows both name and\n> timestamp for author and committer.\n> \n> Signed-off-by: Junio C Hamano <junkio@cox.net>\n> \n> ---\n> \n>  * again, likes, dislikes, don't-cares?\n> \n\nWhy not use:\n\n--show=cdm,atn\n\nfor\nCommitter: date, mail\nAuthor: timestamp,name\n\nor\n\n--show-author=date,timestamp,name\n--show-committer=name,time\n--show=name,date (for both author and committer)\n\nor some such, with --pretty=<something> just a short-hand for those \nshow-options?\n\nWe'll run out of superlatives really quickly if there are more author \nand committer info added sometime in the future, while the --show \nflag(s) can be extended more or less indefinitely.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"}]}