{"thread":{"id":"6993","subject":"[PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","startedAt":"2007-02-27T15:21:04Z","lastAt":"2007-02-28T09:48:01Z","messageCount":18,"participants":["Johannes Schindelin","Linus Torvalds","Junio C Hamano","Andy Parkins"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"35624","messageId":"Pine.LNX.4.63.0702271620390.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6993","inReplyTo":null,"subject":"[PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T15:21:04Z","receivedAt":"2007-02-27T15:21:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nNow, show_date() can print three different kinds of dates: normal,\nrelative and short (%Y-%m-%s) dates.\n\nTo achieve this, the \"int relative\" was changed to \"enum date_mode\nmode\", which has three states: DATE_NORMAL, DATE_RELATIVE and\nDATE_SHORT.\n\nSince existing users of show_date() only call it with relative_date\nbeing either 0 or 1, and DATE_NORMAL and DATE_RELATIVE having these\nvalues, no behaviour is changed.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n cache.h |    3 ++-\n date.c  |   20 ++++++++++++--------\n 2 files changed, 14 insertions(+), 9 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 8bbc142..8f89a8b 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -326,7 +326,8 @@ extern void *read_object_with_reference(const unsigned char *sha1,\n \t\t\t\t\tunsigned long *size,\n \t\t\t\t\tunsigned char *sha1_ret);\n \n-const char *show_date(unsigned long time, int timezone, int relative);\n+enum date_mode { DATE_NORMAL = 0, DATE_RELATIVE, DATE_SHORT };\n+const char *show_date(unsigned long time, int timezone, enum date_mode mode);\n const char *show_rfc2822_date(unsigned long time, int timezone);\n int parse_date(const char *date, char *buf, int bufsize);\n void datestamp(char *buf, int bufsize);\ndiff --git a/date.c b/date.c\nindex 542c004..0ceccbe 100644\n--- a/date.c\n+++ b/date.c\n@@ -55,12 +55,12 @@ static struct tm *time_to_tm(unsigned long time, int tz)\n \treturn gmtime(&t);\n }\n \n-const char *show_date(unsigned long time, int tz, int relative)\n+const char *show_date(unsigned long time, int tz, enum date_mode mode)\n {\n \tstruct tm *tm;\n \tstatic char timebuf[200];\n \n-\tif (relative) {\n+\tif (mode == DATE_RELATIVE) {\n \t\tunsigned long diff;\n \t\tstruct timeval now;\n \t\tgettimeofday(&now, NULL);\n@@ -105,12 +105,16 @@ const char *show_date(unsigned long time, int tz, int relative)\n \ttm = time_to_tm(time, tz);\n \tif (!tm)\n \t\treturn NULL;\n-\tsprintf(timebuf, \"%.3s %.3s %d %02d:%02d:%02d %d %+05d\",\n-\t\tweekday_names[tm->tm_wday],\n-\t\tmonth_names[tm->tm_mon],\n-\t\ttm->tm_mday,\n-\t\ttm->tm_hour, tm->tm_min, tm->tm_sec,\n-\t\ttm->tm_year + 1900, tz);\n+\tif (mode == DATE_SHORT)\n+\t\tsprintf(timebuf, \"%04d-%02d-%02d\", tm->tm_year + 1900,\n+\t\t\t\ttm->tm_mon + 1, tm->tm_mday);\n+\telse\n+\t\tsprintf(timebuf, \"%.3s %.3s %d %02d:%02d:%02d %d %+05d\",\n+\t\t\t\tweekday_names[tm->tm_wday],\n+\t\t\t\tmonth_names[tm->tm_mon],\n+\t\t\t\ttm->tm_mday,\n+\t\t\t\ttm->tm_hour, tm->tm_min, tm->tm_sec,\n+\t\t\t\ttm->tm_year + 1900, tz);\n \treturn timebuf;\n }\n \n-- \n1.5.0.2.2410.g737b\n"},{"id":"35689","messageId":"Pine.LNX.4.64.0702271339550.12485@woody.linux-foundation.org","threadId":"6993","inReplyTo":"Pine.LNX.4.63.0702271620390.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-02-27T21:41:35Z","receivedAt":"2007-02-27T21:41:35Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 27 Feb 2007, Johannes Schindelin wrote:\n> \n> Now, show_date() can print three different kinds of dates: normal,\n> relative and short (%Y-%m-%s) dates.\n> \n> To achieve this, the \"int relative\" was changed to \"enum date_mode\n> mode\", which has three states: DATE_NORMAL, DATE_RELATIVE and\n> DATE_SHORT.\n\nAck. I think this kind of thing is worth it regardless of any of the other \nissues (ie the whole \"changelog\" thing). \n\n\t\tLinus\n"},{"id":"35698","messageId":"7v1wkbclqo.fsf@assigned-by-dhcp.cox.net","threadId":"6993","inReplyTo":"Pine.LNX.4.64.0702271339550.12485@woody.linux-foundation.org","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T21:51:43Z","receivedAt":"2007-02-27T21:51:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> On Tue, 27 Feb 2007, Johannes Schindelin wrote:\n>> \n>> Now, show_date() can print three different kinds of dates: normal,\n>> relative and short (%Y-%m-%s) dates.\n>> \n>> To achieve this, the \"int relative\" was changed to \"enum date_mode\n>> mode\", which has three states: DATE_NORMAL, DATE_RELATIVE and\n>> DATE_SHORT.\n>\n> Ack. I think this kind of thing is worth it regardless of any of the other \n> issues (ie the whole \"changelog\" thing). \n\nAck-on-Ack.\n"},{"id":"35699","messageId":"Pine.LNX.4.64.0702271356300.12485@woody.linux-foundation.org","threadId":"6993","inReplyTo":"Pine.LNX.4.64.0702271339550.12485@woody.linux-foundation.org","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-02-27T21:59:03Z","receivedAt":"2007-02-27T21:59:03Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 27 Feb 2007, Linus Torvalds wrote:\n> \n> Ack. I think this kind of thing is worth it regardless of any of the other \n> issues (ie the whole \"changelog\" thing). \n\nSide note: one of the reasons I like having more fine-grained date flags \nis that I've occasionally wanted a \"show in UTC time\" or \"show everything \nin *my* local time\" option. Sometimes it's a bit hard to compare dates \njust because we show them as they were for the people who did them, not \nin any unified format ;)\n\nI'm not sure how useful that really would end up being, but the whole \napproach of just having a \"date mode\" flag should at least make those \nkinds of things trivial if we ever really want it.\n\n\t\tLinus\n"},{"id":"35702","messageId":"Pine.LNX.4.63.0702272313020.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6993","inReplyTo":"Pine.LNX.4.64.0702271339550.12485@woody.linux-foundation.org","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T22:13:54Z","receivedAt":"2007-02-27T22:13:54Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Linus Torvalds wrote:\n\n> On Tue, 27 Feb 2007, Johannes Schindelin wrote:\n> > \n> > Now, show_date() can print three different kinds of dates: normal, \n> > relative and short (%Y-%m-%s) dates.\n> > \n> > To achieve this, the \"int relative\" was changed to \"enum date_mode \n> > mode\", which has three states: DATE_NORMAL, DATE_RELATIVE and \n> > DATE_SHORT.\n> \n> Ack. I think this kind of thing is worth it regardless of any of the \n> other issues (ie the whole \"changelog\" thing).\n\nGee, thanks!\n\nAnd you are no supporter of a GNU ChangeLog? Imagine being able to produce \na GNU style ChangeLog of the Linux kernel in no time at all...\n\nCiao,\nDscho\n"},{"id":"35705","messageId":"Pine.LNX.4.63.0702272322590.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6993","inReplyTo":"Pine.LNX.4.64.0702271356300.12485@woody.linux-foundation.org","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T22:24:10Z","receivedAt":"2007-02-27T22:24:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Linus Torvalds wrote:\n\n> Side note: one of the reasons I like having more fine-grained date flags \n> is that I've occasionally wanted a \"show in UTC time\" or \"show \n> everything in *my* local time\" option.\n\nI found the --relative-date option very useful to that end, if a bit long \nto type.\n\nCiao,\nDscho\n\nP.S.: It is refreshing to see somebody using the same convention of \none-space-after-full-stop as me. Europeans...\n"},{"id":"35714","messageId":"Pine.LNX.4.64.0702271453030.12485@woody.linux-foundation.org","threadId":"6993","inReplyTo":"Pine.LNX.4.63.0702272313020.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-02-27T23:02:44Z","receivedAt":"2007-02-27T23:02:44Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 27 Feb 2007, Johannes Schindelin wrote:\n> \n> And you are no supporter of a GNU ChangeLog? Imagine being able to produce \n> a GNU style ChangeLog of the Linux kernel in no time at all...\n\nI don't think the GNU style ChangeLog is particularly good. In fact, I \nthink it has an unfortunate tendency (thanks to being per-file-log) to \nencourage people to commit unrelated changes and then explain them per \nfile.\n\nOf course, you can't do that under git anyway, but I sure hope people \ndon't start thinking that they should explain their changes in the git \ncommit messages that way - my point being that certain log formats tend to \nencourage certain behaviour, and the GNU log format I think tends to do \nthat exactly the wrong way around.\n\nThat said, listing the functions that got changed (which I don't know if \nyou did, but some GNU changelogs do) may be a nice thing.\n\nAnd hey, if some project wants GNU changelogs, I'm not against them. I \njust don't think they are in any way \"superior\", and the per-file comments \nreally turn me off.\n\nBut the \"short date + author name\" on one line part I certainly don't \ndisagree with. I often use \"git log --stat\", and the three-line \ndefault header that git uses is a bit verbose (but at least a shortened \ncommit name would be good - one of the things I then do is that I may want \nto look in more detail at a commit).\n\n\t\t\tLinus\n"},{"id":"35715","messageId":"Pine.LNX.4.64.0702271503140.12485@woody.linux-foundation.org","threadId":"6993","inReplyTo":"Pine.LNX.4.63.0702272322590.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-02-27T23:04:41Z","receivedAt":"2007-02-27T23:04:41Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 27 Feb 2007, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Tue, 27 Feb 2007, Linus Torvalds wrote:\n> \n> > Side note: one of the reasons I like having more fine-grained date flags \n> > is that I've occasionally wanted a \"show in UTC time\" or \"show \n> > everything in *my* local time\" option.\n> \n> I found the --relative-date option very useful to that end, if a bit long \n> to type.\n\nThat really doesn't work for stuff that is more than a day old. The \ndifference between \"3 weeks ago\" and \"3 weeks ago\" is not usually very \nobvious.\n\n(Hint: often they are days apart, but the relative date-format will just \nhide any differences due to excessive granularity).\n\n\t\t\tLinus\n"},{"id":"35716","messageId":"7vslcrb3l8.fsf@assigned-by-dhcp.cox.net","threadId":"6993","inReplyTo":"Pine.LNX.4.63.0702272322590.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T23:09:07Z","receivedAt":"2007-02-27T23:09:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Side note: one of the reasons I like having more fine-grained date flags \n>> is that I've occasionally wanted a \"show in UTC time\" or \"show \n>> everything in *my* local time\" option.\n>\n> I found the --relative-date option very useful to that end, if a bit long \n> to type.\n\nHow about --ago as a synonym, and --my-date for obeying TZ?\n\"show in UTC time\" can be had by something like:\n\n\t$ TZ=UTC git log --my-date\n\nI personally am not very happy that \"reflog show @{now}\" gives\nrelative date and not the full datestamp.\n"},{"id":"35717","messageId":"Pine.LNX.4.63.0702280010020.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6993","inReplyTo":"Pine.LNX.4.64.0702271453030.12485@woody.linux-foundation.org","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T23:10:58Z","receivedAt":"2007-02-27T23:10:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Linus Torvalds wrote:\n\n> But the \"short date + author name\" on one line part I certainly don't \n> disagree with.\n\nIf you use \"next\" Git:\n\n\t$ git log --pretty=format:\"%h %ad %an\"\n\nCiao,\nDscho\n"},{"id":"35720","messageId":"Pine.LNX.4.63.0702280012250.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6993","inReplyTo":"Pine.LNX.4.64.0702271503140.12485@woody.linux-foundation.org","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T23:13:01Z","receivedAt":"2007-02-27T23:13:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Linus Torvalds wrote:\n\n> On Tue, 27 Feb 2007, Johannes Schindelin wrote:\n> \n> > On Tue, 27 Feb 2007, Linus Torvalds wrote:\n> > \n> > > Side note: one of the reasons I like having more fine-grained date \n> > > flags is that I've occasionally wanted a \"show in UTC time\" or \"show \n> > > everything in *my* local time\" option.\n> > \n> > I found the --relative-date option very useful to that end, if a bit \n> > long to type.\n> \n> That really doesn't work for stuff that is more than a day old. The \n> difference between \"3 weeks ago\" and \"3 weeks ago\" is not usually very \n> obvious.\n> \n> (Hint: often they are days apart, but the relative date-format will just \n> hide any differences due to excessive granularity).\n\nMaybe we need --relative-but-verbose-date?\n\nCiao,\nDscho\n"},{"id":"35721","messageId":"Pine.LNX.4.63.0702280013130.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6993","inReplyTo":"Pine.LNX.4.64.0702271453030.12485@woody.linux-foundation.org","subject":"GNU ChangeLogs, was Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T23:18:18Z","receivedAt":"2007-02-27T23:18:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Linus Torvalds wrote:\n\n> I don't think the GNU style ChangeLog is particularly good. In fact, I \n> think it has an unfortunate tendency (thanks to being per-file-log) to \n> encourage people to commit unrelated changes and then explain them per \n> file.\n\nYes, that is some bad thing.\n\n> Of course, you can't do that under git anyway, but I sure hope people \n> don't start thinking that they should explain their changes in the git \n> commit messages that way - my point being that certain log formats tend \n> to encourage certain behaviour, and the GNU log format I think tends to \n> do that exactly the wrong way around.\n\nWell, if you have to change your committing behaviour to get sensible \nautomatic GNU ChangeLog from history, that would be a start, wouldn't it?\n\n> That said, listing the functions that got changed (which I don't know if \n> you did, but some GNU changelogs do) may be a nice thing.\n\nNo I did not.\n\nIt is not _that_ easy with existing interfaces. Like I illustrated in an \nexample I sent in another reply, you miss newly introduced functions.\n\nBesides, without my Java-methods patch I sent yesterday, our function name \nextraction is utterly unusable on Java projects (and C++ projects with \ninlined methods).\n\n> And hey, if some project wants GNU changelogs, I'm not against them. I \n> just don't think they are in any way \"superior\", and the per-file \n> comments really turn me off.\n\nI think that the standard behaviour of \"git log\" rocks. But it would not \nhurt to be able to point to \"git log --pretty=gnucl\", to prove that Git is \nthe ultimate SCM.\n\nCiao,\nDscho\n"},{"id":"35722","messageId":"Pine.LNX.4.63.0702280019340.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6993","inReplyTo":"7vslcrb3l8.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T23:20:14Z","receivedAt":"2007-02-27T23:20:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> Side note: one of the reasons I like having more fine-grained date \n> >> flags is that I've occasionally wanted a \"show in UTC time\" or \"show \n> >> everything in *my* local time\" option.\n> >\n> > I found the --relative-date option very useful to that end, if a bit \n> > long to type.\n> \n> How about --ago as a synonym, and --my-date for obeying TZ? \"show in UTC \n> time\" can be had by something like:\n> \n> \t$ TZ=UTC git log --my-date\n\nI like both.\n\n> I personally am not very happy that \"reflog show @{now}\" gives relative \n> date and not the full datestamp.\n\n$ git log -g @{now} \n\nCiao,\nDscho\n"},{"id":"35725","messageId":"7vk5y3b2fr.fsf@assigned-by-dhcp.cox.net","threadId":"6993","inReplyTo":"Pine.LNX.4.63.0702280019340.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T23:34:00Z","receivedAt":"2007-02-27T23:34:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> I personally am not very happy that \"reflog show @{now}\" gives relative \n>> date and not the full datestamp.\n>\n> $ git log -g @{now} \n\nI said \"reflog show\" because I wanted to have oneline and\nabbrev.\n"},{"id":"35732","messageId":"Pine.LNX.4.63.0702280051160.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6993","inReplyTo":"7vk5y3b2fr.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T23:52:35Z","receivedAt":"2007-02-27T23:52:35Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> I personally am not very happy that \"reflog show @{now}\" gives relative \n> >> date and not the full datestamp.\n> >\n> > $ git log -g @{now} \n> \n> I said \"reflog show\" because I wanted to have oneline and abbrev.\n\nAh. Yes.\n\nHowever, when I look at reflogs, usually I know an approximate relative \ndate of the commit I am looking for. I _do_ arithmetic in my head, only \nthat base-60 is a little slow...\n\nCiao,\nDscho\n"},{"id":"35733","messageId":"Pine.LNX.4.64.0702271548030.12485@woody.linux-foundation.org","threadId":"6993","inReplyTo":"Pine.LNX.4.63.0702280010020.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-02-27T23:53:06Z","receivedAt":"2007-02-27T23:53:06Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 28 Feb 2007, Johannes Schindelin wrote:\n> \n> If you use \"next\" Git:\n> \n> \t$ git log --pretty=format:\"%h %ad %an\"\n\nWell, that has the long-format date, which really isn't appropriate for a \none-liner format. \n\nIt's one of the reasons I agreed with your show_date() changes: I think \nour date output formats are fairly limited. I love the long date format, \nbut if I want to show a commit name and author name and email on the same \nline, no way can we use 30+ characters for just the date.\n\nSo the part about the GNU ChangeLog format I like is the single-line \nheader thing.. Right now, the choice between \"--pretty=xxx\" choices is \n\"oneline\", \"short\", \"medium\", and there's something lacking there in \nbetween (\"terse\").\n\nThe \"format:\" thing certainly gives us more options to play with, though.\n\n\t\t\tLinus\n"},{"id":"35736","messageId":"Pine.LNX.4.64.0702271554120.12485@woody.linux-foundation.org","threadId":"6993","inReplyTo":"7vslcrb3l8.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] show_date(): rename the \"relative\" parameter to \"mode\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-02-27T23:59:43Z","receivedAt":"2007-02-27T23:59:43Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 27 Feb 2007, Junio C Hamano wrote:\n> \n> How about --ago as a synonym, and --my-date for obeying TZ?\n> \"show in UTC time\" can be had by something like:\n> \n> \t$ TZ=UTC git log --my-date\n\nYes, although I would suggest that at that point we also use a shorter \ndate format, since the timezone (by definition) is no longer valid or \ninteresting.\n\nBut in general, there are other date issues - if we start showing the date \nin other non-rfc2822 formats (like skipping the timezone), we migth as \nwell also support denser times..\n\nFor example, I occasionally love seeing the seconds, especially when I \napply a series of patches from Andrew, and I see myself committing 5-6 \npatches per second - but it's just noise if you want a single-line thing. \nSo showing dates as \"yyyy-mm-dd hh:mm\" makes sense (and sorts properly).\n\nSo instead of \"--my-date\", I'd suggest \"--date[-format]=xyz\" as an option, \npossibly even with a way to set some defaults for \"git log\" using the \nconfig file. \n\n\t\tLinus\n"},{"id":"35792","messageId":"200702280948.05391.andyparkins@gmail.com","threadId":"6993","inReplyTo":"Pine.LNX.4.64.0702271453030.12485@woody.linux-foundation.org","subject":"OT: Favourite log message layout","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-02-28T09:48:01Z","receivedAt":"2007-02-28T09:48:01Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 February 27 23:02, Linus Torvalds wrote:\n\n> I don't think the GNU style ChangeLog is particularly good. In fact, I\n> think it has an unfortunate tendency (thanks to being per-file-log) to\n> encourage people to commit unrelated changes and then explain them per\n> file.\n\nMe either; however, I do like per-file information.  My own favoured format \nfor log messages is (with all but the shortlog optional)\n\n---- 8< ----\nShort log message summarises changes in one line\n\nLonger message summarises changes, perhaps with reasons for change and why \nthis change fixes something.\n\nfile1.c\n * detailed description of change to this file\n * more changes\n\nfile2.c\n * detailed description of change to this file\n---- >8 ----\n\nThat's not to say that this is an excuse to lump unrelated changes together, \nbut it does allow one to say\n\n file1.c\n  * Added function xyz()\n\n file2.c\n  * Call new function xyz() to achieve clever feature\n\nwhen it's appropriate.  I've found this particularly useful in conjunction \nwith git-blame.  You find the revision that made a change in a particular \nfile then the log message is easily searched to find the exact reasons for \nthat change on that line in that file.\n\nPerhaps I'm overly verbose though.  I do like the sound of my own voice - even \non log messages :-)\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"}]}