{"thread":{"id":"11816","subject":"[PATCH] --format=pretty: new modifiers cID, cIS, CIY","startedAt":"2008-02-01T22:12:53Z","lastAt":"2008-02-02T01:15:38Z","messageCount":7,"participants":["Jari Aalto","Junio C Hamano","Tommy Thorn"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"67041","messageId":"odb072ca.fsf@blue.sea.net","threadId":"11816","inReplyTo":null,"subject":"[PATCH] --format=pretty: new modifiers cID, cIS, CIY","fromName":"Jari Aalto","fromEmail":"jari.aalto@cante.net","sentAt":"2008-02-01T22:12:53Z","receivedAt":"2008-02-01T22:12:53Z","isPatch":true,"sender":{"key":"jari.aalto@cante.net","avatar":"https://avatars.githubusercontent.com/u/34601?v=4"},"body":"The default ISO 8601 modifier %ci is quite verbose displaying\neverything up to the timezone. This consumes considerable amount of\ncharacters.  The new modifiers offer way to display just the needed\namount of information, down to:\n\n\t%cID\tdate: YYYY-MM-DD\n\t%cIH\thour: YYYY-MM-DD HH:MM\n\t%cIS\tsecond: YYYY-MM-DD HH:MM:SS\n\nSigned-off-by: Jari Aalto <jari.aalto AT cante.net>\n---\n Documentation/pretty-formats.txt |    5 ++++-\n cache.h                          |    3 +++\n date.c                           |   17 +++++++++++++++++\n pretty.c                         |   35 ++++++++++++++++++++++++++++++-----\n 4 files changed, 54 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex 0193c3c..cb1bbac 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -113,7 +113,10 @@ The placeholders are:\n - '%cD': committer date, RFC2822 style\n - '%cr': committer date, relative\n - '%ct': committer date, UNIX timestamp\n-- '%ci': committer date, ISO 8601 format\n+- '%ci': committer date, ISO 8601 format, long YYYY-MM-DD HH:MM:SS TZ\n+- '%cIM': committer date, ISO 8601 format, short YYYY-MM-DD HH:MM\n+- '%cIS': committer date, ISO 8601 format, short YYYY-MM-DD HH:MM:SS\n+- '%cID': committer date, ISO 8601 format, short YYYY-MM-DD\n - '%e': encoding\n - '%s': subject\n - '%b': body\ndiff --git a/cache.h b/cache.h\nindex 549f4bb..1fae94a 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -444,6 +444,9 @@ enum date_mode {\n \tDATE_SHORT,\n \tDATE_LOCAL,\n \tDATE_ISO8601,\n+\tDATE_ISO8601_YYYYMMDD,\n+\tDATE_ISO8601_YYYYMMDDHHMM,\n+\tDATE_ISO8601_YYYYMMDDHHMMSS,\n \tDATE_RFC2822\n };\n \ndiff --git a/date.c b/date.c\nindex 8f70500..ded9caa 100644\n--- a/date.c\n+++ b/date.c\n@@ -144,6 +144,23 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode)\n \t\t\t\ttm->tm_mday,\n \t\t\t\ttm->tm_hour, tm->tm_min, tm->tm_sec,\n \t\t\t\ttz);\n+\telse if (mode == DATE_ISO8601_YYYYMMDD)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d\",\n+\t\t\t\ttm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1,\n+\t\t\t\ttm->tm_mday);\n+\telse if (mode == DATE_ISO8601_YYYYMMDDHHMM)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d %02d:%02d\",\n+\t\t\t\ttm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1,\n+\t\t\t\ttm->tm_mday,\n+\t\t\t\ttm->tm_hour, tm->tm_min);\n+\telse if (mode == DATE_ISO8601_YYYYMMDDHHMMSS)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d %02d:%02d:%02d\",\n+\t\t\t\ttm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1,\n+\t\t\t\ttm->tm_mday,\n+\t\t\t\ttm->tm_hour, tm->tm_min, tm->tm_sec);\n \telse if (mode == DATE_RFC2822)\n \t\tsprintf(timebuf, \"%.3s, %d %.3s %d %02d:%02d:%02d %+05d\",\n \t\t\tweekday_names[tm->tm_wday], tm->tm_mday,\ndiff --git a/pretty.c b/pretty.c\nindex b987ff2..5a8774b 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -282,9 +282,11 @@ static char *logmsg_reencode(const struct commit *commit,\n \treturn out;\n }\n \n-static void format_person_part(struct strbuf *sb, char part,\n-                               const char *msg, int len)\n+static void format_person_part(struct strbuf *sb, char *ptr,\n+\t\t\t       const char *msg, int len)\n {\n+\tchar part = ptr[0];\n+\tchar next = ptr[1];\n \tint start, end, tz = 0;\n \tunsigned long date;\n \tchar *ep;\n@@ -359,6 +361,26 @@ static void format_person_part(struct strbuf *sb, char part,\n \tcase 'i':\t/* date, ISO 8601 */\n \t\tstrbuf_addstr(sb, show_date(date, tz, DATE_ISO8601));\n \t\treturn;\n+\tcase 'I':\t/* date, ISO 8601 + fine grained details */\n+\t\tswitch (next) {\n+\t\tcase 'D':\t/* up till date */\n+\t\t\tstrbuf_addstr(sb,\n+\t\t\t\t\tshow_date(date, tz,\n+\t\t\t\t\t\tDATE_ISO8601_YYYYMMDD));\n+\t\t\treturn;\n+\t\tcase 'S':\t/* up till date + sec */\n+\t\t\tstrbuf_addstr(sb,\n+\t\t\t\t\tshow_date(date, tz,\n+\t\t\t\t\t\tDATE_ISO8601_YYYYMMDDHHMMSS));\n+\n+\t\t\treturn;\n+\t\tdefault:\t/* up till hour */\n+\t\t\tstrbuf_addstr(sb,\n+\t\t\t\t\tshow_date(date, tz,\n+\t\t\t\t\t\tDATE_ISO8601_YYYYMMDDHHMM));\n+\n+\t\t}\n+\t\treturn;\n \t}\n }\n \n@@ -532,11 +554,11 @@ static void format_commit_item(struct strbuf *sb, const char *placeholder,\n \t\tstrbuf_add(sb, msg + c->subject.off, c->subject.len);\n \t\treturn;\n \tcase 'a':\n-\t\tformat_person_part(sb, placeholder[1],\n+\t\tformat_person_part(sb, placeholder + 1,\n \t\t                   msg + c->author.off, c->author.len);\n \t\treturn;\n \tcase 'c':\n-\t\tformat_person_part(sb, placeholder[1],\n+\t\tformat_person_part(sb, placeholder + 1,\n \t\t                   msg + c->committer.off, c->committer.len);\n \t\treturn;\n \tcase 'e':\n@@ -571,7 +593,10 @@ void format_commit_message(const struct commit *commit,\n \t\t\"cD\",\t\t/* committer date, RFC2822 style */\n \t\t\"cr\",\t\t/* committer date, relative */\n \t\t\"ct\",\t\t/* committer date, UNIX timestamp */\n-\t\t\"ci\",\t\t/* committer date, ISO 8601 */\n+\t\t\"ci\",\t\t/* committer date, ISO 8601 full, with TZ */\n+\t\t\"cID\",\t\t/* committer date, ISO 8601 YYYY-MM-DD */\n+\t\t\"cIM\",\t\t/* committer date, ISO 8601 YYYY-MM-DD HH:MM */\n+\t\t\"cIS\",\t\t/* committer date, ISO 8601 YYYY-MM-DD HH:MM:SS*/\n \t\t\"e\",\t\t/* encoding */\n \t\t\"s\",\t\t/* subject */\n \t\t\"b\",\t\t/* body */\n-- \n1.5.4-rc5.GIT-dirty\n\n\n-- \nWelcome to FOSS revolution: we fix and modify until it shines\n"},{"id":"67045","messageId":"fxwc70xa.fsf@blue.sea.net","threadId":"11816","inReplyTo":"odb072ca.fsf@blue.sea.net","subject":"[PATCH] --format=pretty: new modifiers cID, cIM, CIS","fromName":"Jari Aalto","fromEmail":"jari.aalto@cante.net","sentAt":"2008-02-01T22:43:29Z","receivedAt":"2008-02-01T22:43:29Z","isPatch":true,"sender":{"key":"jari.aalto@cante.net","avatar":"https://avatars.githubusercontent.com/u/34601?v=4"},"body":"The default ISO 8601 modifier %ci is quite verbose displaying\neverything up to the timezone. This consumes considerable amount of\ncharacters.  The new modifiers offer way to display just the needed\namount of information, down to:\n\n        %cID    date: YYYY-MM-DD\n        %cIM    hour: YYYY-MM-DD HH:MM\n        %cIS    second: YYYY-MM-DD HH:MM:SS\n\nSigned-off-by: Jari Aalto <jari.aalto AT cante.net>\n---\n\n ******************************************************\n THIS IS SAME PATCH- ONLY COMMIT MESSAGE HAS BEEN FIXED\n TO SYNCH WITH THE CONTENT\n ******************************************************\n\n Documentation/pretty-formats.txt |    5 ++++-\n cache.h                          |    3 +++\n date.c                           |   17 +++++++++++++++++\n pretty.c                         |   35 ++++++++++++++++++++++++++++++-----\n 4 files changed, 54 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex 0193c3c..cb1bbac 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -113,7 +113,10 @@ The placeholders are:\n - '%cD': committer date, RFC2822 style\n - '%cr': committer date, relative\n - '%ct': committer date, UNIX timestamp\n-- '%ci': committer date, ISO 8601 format\n+- '%ci': committer date, ISO 8601 format, long YYYY-MM-DD HH:MM:SS TZ\n+- '%cIM': committer date, ISO 8601 format, short YYYY-MM-DD HH:MM\n+- '%cIS': committer date, ISO 8601 format, short YYYY-MM-DD HH:MM:SS\n+- '%cID': committer date, ISO 8601 format, short YYYY-MM-DD\n - '%e': encoding\n - '%s': subject\n - '%b': body\ndiff --git a/cache.h b/cache.h\nindex 549f4bb..1fae94a 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -444,6 +444,9 @@ enum date_mode {\n \tDATE_SHORT,\n \tDATE_LOCAL,\n \tDATE_ISO8601,\n+\tDATE_ISO8601_YYYYMMDD,\n+\tDATE_ISO8601_YYYYMMDDHHMM,\n+\tDATE_ISO8601_YYYYMMDDHHMMSS,\n \tDATE_RFC2822\n };\n \ndiff --git a/date.c b/date.c\nindex 8f70500..ded9caa 100644\n--- a/date.c\n+++ b/date.c\n@@ -144,6 +144,23 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode)\n \t\t\t\ttm->tm_mday,\n \t\t\t\ttm->tm_hour, tm->tm_min, tm->tm_sec,\n \t\t\t\ttz);\n+\telse if (mode == DATE_ISO8601_YYYYMMDD)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d\",\n+\t\t\t\ttm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1,\n+\t\t\t\ttm->tm_mday);\n+\telse if (mode == DATE_ISO8601_YYYYMMDDHHMM)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d %02d:%02d\",\n+\t\t\t\ttm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1,\n+\t\t\t\ttm->tm_mday,\n+\t\t\t\ttm->tm_hour, tm->tm_min);\n+\telse if (mode == DATE_ISO8601_YYYYMMDDHHMMSS)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d %02d:%02d:%02d\",\n+\t\t\t\ttm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1,\n+\t\t\t\ttm->tm_mday,\n+\t\t\t\ttm->tm_hour, tm->tm_min, tm->tm_sec);\n \telse if (mode == DATE_RFC2822)\n \t\tsprintf(timebuf, \"%.3s, %d %.3s %d %02d:%02d:%02d %+05d\",\n \t\t\tweekday_names[tm->tm_wday], tm->tm_mday,\ndiff --git a/pretty.c b/pretty.c\nindex b987ff2..5a8774b 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -282,9 +282,11 @@ static char *logmsg_reencode(const struct commit *commit,\n \treturn out;\n }\n \n-static void format_person_part(struct strbuf *sb, char part,\n-                               const char *msg, int len)\n+static void format_person_part(struct strbuf *sb, char *ptr,\n+\t\t\t       const char *msg, int len)\n {\n+\tchar part = ptr[0];\n+\tchar next = ptr[1];\n \tint start, end, tz = 0;\n \tunsigned long date;\n \tchar *ep;\n@@ -359,6 +361,26 @@ static void format_person_part(struct strbuf *sb, char part,\n \tcase 'i':\t/* date, ISO 8601 */\n \t\tstrbuf_addstr(sb, show_date(date, tz, DATE_ISO8601));\n \t\treturn;\n+\tcase 'I':\t/* date, ISO 8601 + fine grained details */\n+\t\tswitch (next) {\n+\t\tcase 'D':\t/* up till date */\n+\t\t\tstrbuf_addstr(sb,\n+\t\t\t\t\tshow_date(date, tz,\n+\t\t\t\t\t\tDATE_ISO8601_YYYYMMDD));\n+\t\t\treturn;\n+\t\tcase 'S':\t/* up till date + sec */\n+\t\t\tstrbuf_addstr(sb,\n+\t\t\t\t\tshow_date(date, tz,\n+\t\t\t\t\t\tDATE_ISO8601_YYYYMMDDHHMMSS));\n+\n+\t\t\treturn;\n+\t\tdefault:\t/* up till hour */\n+\t\t\tstrbuf_addstr(sb,\n+\t\t\t\t\tshow_date(date, tz,\n+\t\t\t\t\t\tDATE_ISO8601_YYYYMMDDHHMM));\n+\n+\t\t}\n+\t\treturn;\n \t}\n }\n \n@@ -532,11 +554,11 @@ static void format_commit_item(struct strbuf *sb, const char *placeholder,\n \t\tstrbuf_add(sb, msg + c->subject.off, c->subject.len);\n \t\treturn;\n \tcase 'a':\n-\t\tformat_person_part(sb, placeholder[1],\n+\t\tformat_person_part(sb, placeholder + 1,\n \t\t                   msg + c->author.off, c->author.len);\n \t\treturn;\n \tcase 'c':\n-\t\tformat_person_part(sb, placeholder[1],\n+\t\tformat_person_part(sb, placeholder + 1,\n \t\t                   msg + c->committer.off, c->committer.len);\n \t\treturn;\n \tcase 'e':\n@@ -571,7 +593,10 @@ void format_commit_message(const struct commit *commit,\n \t\t\"cD\",\t\t/* committer date, RFC2822 style */\n \t\t\"cr\",\t\t/* committer date, relative */\n \t\t\"ct\",\t\t/* committer date, UNIX timestamp */\n-\t\t\"ci\",\t\t/* committer date, ISO 8601 */\n+\t\t\"ci\",\t\t/* committer date, ISO 8601 full, with TZ */\n+\t\t\"cID\",\t\t/* committer date, ISO 8601 YYYY-MM-DD */\n+\t\t\"cIM\",\t\t/* committer date, ISO 8601 YYYY-MM-DD HH:MM */\n+\t\t\"cIS\",\t\t/* committer date, ISO 8601 YYYY-MM-DD HH:MM:SS*/\n \t\t\"e\",\t\t/* encoding */\n \t\t\"s\",\t\t/* subject */\n \t\t\"b\",\t\t/* body */\n-- \n1.5.4-rc5.GIT-dirty\n"},{"id":"67046","messageId":"7vir188ej4.fsf@gitster.siamese.dyndns.org","threadId":"11816","inReplyTo":"odb072ca.fsf@blue.sea.net","subject":"Re: [PATCH] --format=pretty: new modifiers cID, cIS, CIY","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-01T23:04:15Z","receivedAt":"2008-02-01T23:04:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jari Aalto <jari.aalto@cante.net> writes:\n\n> +\tcase 'I':\t/* date, ISO 8601 + fine grained details */\n> +\t\tswitch (next) {\n> +\t\tcase 'D':\t/* up till date */\n> +\t\t\tstrbuf_addstr(sb,\n> +\t\t\t\t\tshow_date(date, tz,\n> +\t\t\t\t\t\tDATE_ISO8601_YYYYMMDD));\n> +\t\t\treturn;\n> +\t\tcase 'S':\t/* up till date + sec */\n> +\t\t\tstrbuf_addstr(sb,\n> +\t\t\t\t\tshow_date(date, tz,\n> +\t\t\t\t\t\tDATE_ISO8601_YYYYMMDDHHMMSS));\n> +\n> +\t\t\treturn;\n> +\t\tdefault:\t/* up till hour */\n> +\t\t\tstrbuf_addstr(sb,\n> +\t\t\t\t\tshow_date(date, tz,\n> +\t\t\t\t\t\tDATE_ISO8601_YYYYMMDDHHMM));\n> +\n> +\t\t}\n> +\t\treturn;\n\nI think this \"default\" is not quite nice.  If you want to\nsupport down-to-hour, you'd beter explicitly support 'H'.\n\"default:\" should error out, saying \"Ah, oh, sorry, I do not\nsupport %cIX (yet)\".\n\nOtherwise, it casts the set of truncated ISO 8601 date format we\nsupports in stone.  People would depend on being able to say\n\"%cIhour\" and a new implementation cannot introduce %cIh\nmodifier that means something.\n\nBut I do not like the idea of adding more short-hand format this\nway.  I think we would very much prefer, instead of piling hacks\non top of the originally supported \"minimum set\", to introduce a\ntruly extensible syntax, like:\n\n\t%cT(flexible formatting specification for committer time)\n\nor even\n\n\t%c(flexible formatting specification for committer info)\n\nand that specification may say which field to format with what\nprettiness.  For example:\n\n\t%c(name|initial) %c(time|local,HH:MM) %c(time|gmt,HH) <%c(email)>\n\nmight say:\n\n\tJCH 15:00 23 <gitster@pobox.com>\n\n(23 is because US/Pacific is 8 hours behind right now).\n\nOf course, %a(likewise for author time) can be defined the same\nway.\n"},{"id":"67047","messageId":"96032.15671.qm@web39506.mail.mud.yahoo.com","threadId":"11816","inReplyTo":"7vir188ej4.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] --format=pretty: new modifiers cID, cIS, CIY","fromName":"Tommy Thorn","fromEmail":"tt1729@yahoo.com","sentAt":"2008-02-01T23:16:12Z","receivedAt":"2008-02-01T23:16:12Z","isPatch":true,"sender":{"key":"tommy-git@thorn.ws","avatar":null},"body":"[resent, sorry]\n\n--- Junio C Hamano <gitster@pobox.com> wrote:\n> I think we would very much prefer, instead of\n> piling hacks on top of the originally supported \n> \"minimum set\", to introduce a truly extensible \n> syntax, like:\n\nI concur, but pretty-please make it a super set of \ndate(1) to the extent possible. It will lessen the \nconfusion. \n\nMaybe something like \"%c(%Y-%m-%d %H:%M) ...\", eg.\nsuch\nthat if `date +<format>' is legal, so is\n\"%c(<format>)\".\n\nTommy\n\n\n      ____________________________________________________________________________________\nLooking for last minute shopping deals?  \nFind them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping\n"},{"id":"67049","messageId":"7vabmk8dd4.fsf@gitster.siamese.dyndns.org","threadId":"11816","inReplyTo":"96032.15671.qm@web39506.mail.mud.yahoo.com","subject":"Re: [PATCH] --format=pretty: new modifiers cID, cIS, CIY","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-01T23:29:27Z","receivedAt":"2008-02-01T23:29:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tommy Thorn <tt1729@yahoo.com> writes:\n\n> [resent, sorry]\n>\n> --- Junio C Hamano <gitster@pobox.com> wrote:\n>> I think we would very much prefer, instead of\n>> piling hacks on top of the originally supported \n>> \"minimum set\", to introduce a truly extensible \n>> syntax, like:\n>\n> I concur, but pretty-please make it a super set of \n> date(1) to the extent possible. It will lessen the \n> confusion. \n>\n> Maybe something like \"%c(%Y-%m-%d %H:%M) ...\", eg.\n> such\n> that if `date +<format>' is legal, so is\n> \"%c(<format>)\".\n\nPlease read what you are replying to again.  If you said the\nabove with %cT(...), it might have made some sense (but then how\nare you differentiate between local and original timezone?), but\n%c(...) needs to show not just the timestamp.\n"},{"id":"67057","messageId":"bq706u15.fsf@blue.sea.net","threadId":"11816","inReplyTo":"7vir188ej4.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] --format=pretty: new modifiers cID, cIS, CIY","fromName":"Jari Aalto","fromEmail":"jari.aalto@cante.net","sentAt":"2008-02-02T01:12:22Z","receivedAt":"2008-02-02T01:12:22Z","isPatch":true,"sender":{"key":"jari.aalto@cante.net","avatar":"https://avatars.githubusercontent.com/u/34601?v=4"},"body":"The default ISO 8601 modifier %ci is quite verbose displaying\neverything up to the timezone. This consumes considerable amount of\ncharacters.  The new modifiers offer way to display just the needed\namount of information, down to:\n\n        %cID    date: YYYY-MM-DD\n        %cIM    hour: YYYY-MM-DD HH:MM\n        %cIS    second: YYYY-MM-DD HH:MM:SS\n\nSigned-off-by: Jari Aalto <jari.aalto AT cante.net>\n---\n > I think this \"default\" is not quite nice.  If you want to\n > support down-to-hour, you'd beter explicitly support 'H'.\n > \"default:\" should error out, saying \"Ah, oh, sorry, I do not\n > support %cIX (yet)\".\n\n Here is correction and better 'case::default'.\n\n Jari\n\n Documentation/pretty-formats.txt |    5 ++++-\n cache.h                          |    3 +++\n date.c                           |   17 +++++++++++++++++\n pretty.c                         |   36 +++++++++++++++++++++++++++++++-----\n 4 files changed, 55 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex 0193c3c..cb1bbac 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -113,7 +113,10 @@ The placeholders are:\n - '%cD': committer date, RFC2822 style\n - '%cr': committer date, relative\n - '%ct': committer date, UNIX timestamp\n-- '%ci': committer date, ISO 8601 format\n+- '%ci': committer date, ISO 8601 format, long YYYY-MM-DD HH:MM:SS TZ\n+- '%cIM': committer date, ISO 8601 format, short YYYY-MM-DD HH:MM\n+- '%cIS': committer date, ISO 8601 format, short YYYY-MM-DD HH:MM:SS\n+- '%cID': committer date, ISO 8601 format, short YYYY-MM-DD\n - '%e': encoding\n - '%s': subject\n - '%b': body\ndiff --git a/cache.h b/cache.h\nindex 549f4bb..1fae94a 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -444,6 +444,9 @@ enum date_mode {\n \tDATE_SHORT,\n \tDATE_LOCAL,\n \tDATE_ISO8601,\n+\tDATE_ISO8601_YYYYMMDD,\n+\tDATE_ISO8601_YYYYMMDDHHMM,\n+\tDATE_ISO8601_YYYYMMDDHHMMSS,\n \tDATE_RFC2822\n };\n \ndiff --git a/date.c b/date.c\nindex 8f70500..ded9caa 100644\n--- a/date.c\n+++ b/date.c\n@@ -144,6 +144,23 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode)\n \t\t\t\ttm->tm_mday,\n \t\t\t\ttm->tm_hour, tm->tm_min, tm->tm_sec,\n \t\t\t\ttz);\n+\telse if (mode == DATE_ISO8601_YYYYMMDD)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d\",\n+\t\t\t\ttm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1,\n+\t\t\t\ttm->tm_mday);\n+\telse if (mode == DATE_ISO8601_YYYYMMDDHHMM)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d %02d:%02d\",\n+\t\t\t\ttm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1,\n+\t\t\t\ttm->tm_mday,\n+\t\t\t\ttm->tm_hour, tm->tm_min);\n+\telse if (mode == DATE_ISO8601_YYYYMMDDHHMMSS)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d %02d:%02d:%02d\",\n+\t\t\t\ttm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1,\n+\t\t\t\ttm->tm_mday,\n+\t\t\t\ttm->tm_hour, tm->tm_min, tm->tm_sec);\n \telse if (mode == DATE_RFC2822)\n \t\tsprintf(timebuf, \"%.3s, %d %.3s %d %02d:%02d:%02d %+05d\",\n \t\t\tweekday_names[tm->tm_wday], tm->tm_mday,\ndiff --git a/pretty.c b/pretty.c\nindex b987ff2..778faf4 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -282,9 +282,11 @@ static char *logmsg_reencode(const struct commit *commit,\n \treturn out;\n }\n \n-static void format_person_part(struct strbuf *sb, char part,\n-                               const char *msg, int len)\n+static void format_person_part(struct strbuf *sb, char *ptr,\n+\t\t\t       const char *msg, int len)\n {\n+\tchar part = ptr[0];\n+\tchar next = ptr[1];\n \tint start, end, tz = 0;\n \tunsigned long date;\n \tchar *ep;\n@@ -359,6 +361,27 @@ static void format_person_part(struct strbuf *sb, char part,\n \tcase 'i':\t/* date, ISO 8601 */\n \t\tstrbuf_addstr(sb, show_date(date, tz, DATE_ISO8601));\n \t\treturn;\n+\tcase 'I':\t/* date, ISO 8601 + fine grained details */\n+\t\tswitch (next) {\n+\t\tcase 'D':\t/* up till date */\n+\t\t\tstrbuf_addstr(sb,\n+\t\t\t\t\tshow_date(date, tz,\n+\t\t\t\t\t\tDATE_ISO8601_YYYYMMDD));\n+\t\tcase 'H':\t/* up till hour */\n+\t\t\tstrbuf_addstr(sb,\n+\t\t\t\t\tshow_date(date, tz,\n+\t\t\t\t\t\tDATE_ISO8601_YYYYMMDDHHMM));\n+\t\tcase 'S':\t/* up till date + sec */\n+\t\t\tstrbuf_addstr(sb,\n+\t\t\t\t\tshow_date(date, tz,\n+\t\t\t\t\t\tDATE_ISO8601_YYYYMMDDHHMMSS));\n+\n+\t\tdefault:\t/* up till hour */\n+\t\t\tfprintf(stderr, \"Error, uknown %%cI%c modifier\",\n+\t\t\t\tnext);\n+\n+\t\t}\n+\t\treturn;\n \t}\n }\n \n@@ -532,11 +555,11 @@ static void format_commit_item(struct strbuf *sb, const char *placeholder,\n \t\tstrbuf_add(sb, msg + c->subject.off, c->subject.len);\n \t\treturn;\n \tcase 'a':\n-\t\tformat_person_part(sb, placeholder[1],\n+\t\tformat_person_part(sb, placeholder + 1,\n \t\t                   msg + c->author.off, c->author.len);\n \t\treturn;\n \tcase 'c':\n-\t\tformat_person_part(sb, placeholder[1],\n+\t\tformat_person_part(sb, placeholder + 1,\n \t\t                   msg + c->committer.off, c->committer.len);\n \t\treturn;\n \tcase 'e':\n@@ -571,7 +594,10 @@ void format_commit_message(const struct commit *commit,\n \t\t\"cD\",\t\t/* committer date, RFC2822 style */\n \t\t\"cr\",\t\t/* committer date, relative */\n \t\t\"ct\",\t\t/* committer date, UNIX timestamp */\n-\t\t\"ci\",\t\t/* committer date, ISO 8601 */\n+\t\t\"ci\",\t\t/* committer date, ISO 8601 full, with TZ */\n+\t\t\"cID\",\t\t/* committer date, ISO 8601 YYYY-MM-DD */\n+\t\t\"cIM\",\t\t/* committer date, ISO 8601 YYYY-MM-DD HH:MM */\n+\t\t\"cIS\",\t\t/* committer date, ISO 8601 YYYY-MM-DD HH:MM:SS*/\n \t\t\"e\",\t\t/* encoding */\n \t\t\"s\",\t\t/* subject */\n \t\t\"b\",\t\t/* body */\n-- \n1.5.4-rc5.GIT-dirty\n"},{"id":"67058","messageId":"7iho6tvp.fsf@blue.sea.net","threadId":"11816","inReplyTo":"7vir188ej4.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] --format=pretty: new modifiers cID, cIS, CIY","fromName":"Jari Aalto","fromEmail":"jari.aalto@cante.net","sentAt":"2008-02-02T01:15:38Z","receivedAt":"2008-02-02T01:15:38Z","isPatch":true,"sender":{"key":"jari.aalto@cante.net","avatar":"https://avatars.githubusercontent.com/u/34601?v=4"},"body":"* Fri 2008-02-01 Junio C Hamano <gitster@pobox.com>\n> But I do not like the idea of adding more short-hand format this\n> way.\n\nI'd welcome if this mimimum set of ISO date handling woudl be included,\nbecause I feel they address the needs more versatily than the current\n%ci, which is too long with down to TZ.\n\nI find it that the YYY-MM-DD HH:MM meets the needs 99% of the case, like\nin ls(1) listing when the LC_* is properly configured.\n\n[extensible syntax]\n> \t%c(name|initial) %c(time|local,HH:MM) %c(time|gmt,HH) <%c(email)>\n\nThis would be good. In the mean time, when we wait for this feature to\nsurface, the current patch would address immediate needs.\n\nJari\n\n-- \nWelcome to FOSS revolution: we fix and modify until it shines\n"}]}