From: Jeff King <peff@peff.net>
To: Eugene Letuchy <eletuchy@gmail.com>
Cc: git@vger.kernel.org, marius@trolltech.com,
Eugene Letuchy <eugene@facebook.com>
Subject: Re: [PATCH] Make git blame date output format configurable, a la git log
Date: Fri, 20 Feb 2009 12:18:25 -0500 [thread overview]
Message-ID: <20090220171825.GA4636@coredump.intra.peff.net> (raw)
In-Reply-To: <fbb390660902200813h2455eak4e72144c7c491ef9@mail.gmail.com>
On Fri, Feb 20, 2009 at 08:13:34AM -0800, Eugene Letuchy wrote:
> Good call. I can change to using --date instead of --date-format. It
> wasn't clear that this was an unused option.
Yeah, it is a slight confusion both to developers and to users that
programs which take revision arguments sometimes accept but ignore them.
But the revs.date_mode set by the revision library is basically just
used by log-tree, which is not used by blame. So it is safe to reuse,
and doing so actually reduces confusion.
> For parity with log.date, config blame.date still makes sense, right?
Sure. It might even make sense to have an unset blame.date default to
the value of log.date. But I don't use log.date, nor do I directly use
blame (I use tig's blame mode). So I don't know what people expect or
would find useful.
> > So there are actually two changes here:
> >
> > 1. support specifying date format
> >
> > 2. changing the default date format
> >
> > I think (1) is a good change, but it should definitely not be lumped in
> > with (2), as people might like one and not the other (and I happen not
> > to like (2)).
> >
> What about consistency with all git-rev-list clients?
I think blame is a bit different than other clients because it is
showing the date on a line with a bunch of other stuff, whereas most
clients use "Date: <whatever>" on a separate line. So it has to be a bit
more careful about how much space is used.
That being said, I think this discussion proves my main point, which is
that it should be split into two patches. Then discussion over the
default format will not hold up the --date support.
> > gives me relative output on some lines, and not on others. E.g.,
> [...]
> According to date.c comments, this is a "feature" of DATE_RELATIVE:
Oh, right. Sorry for the noise, I totally forgot about that that feature
(which I now remember annoying me in the past, too).
> /* Say months for the past 12 months or so */
> if (diff < 360) {
> snprintf(timebuf, sizeof(timebuf), "%lu months
> ago", (diff + 15) / 30);
> return timebuf;
> }
> /* Else fall back on absolute format.. */
>
> A single line fixes that to be a bit more logical:
> - /* Else fall back on absolute format.. */
> + /* Else fall back to the short format */
> + mode = DATE_SHORT;
>
> but i think that's a separate commit, no?
I do think that's a reasonable change; there's no point in giving a very
precise date for things more than a year past when we have already
dropped precision to "month" for everything else. But definitely a
separate commit.
Personally, I think I would rather see "months" up until about 2-3
years, and then simply "N years ago" after that.
> I have a patch to fix the alignment issues: it figures out the max
> width of each date format and memsets in that number of spaces in
> format_time. Is it better to submit that as a separate commit, or send
> a revised patch?
I think it makes sense to send a revised patch with all of the changes
we've discussed (please mark it as v2 and give a brief summary of what's
changed below the "---" marker to help out other reviewers).
-Peff
next prev parent reply other threads:[~2009-02-20 17:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-20 13:24 [PATCH] Make git blame date output format configurable, a la git log eletuchy
2009-02-20 13:40 ` Johannes Schindelin
2009-02-20 13:55 ` Eugene Letuchy
2009-02-20 13:57 ` Eugene Letuchy
2009-02-20 14:06 ` Johannes Schindelin
2009-02-20 14:27 ` Jeff King
2009-02-20 16:13 ` Eugene Letuchy
2009-02-20 17:18 ` Jeff King [this message]
2009-02-20 16:59 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090220171825.GA4636@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=eletuchy@gmail.com \
--cc=eugene@facebook.com \
--cc=git@vger.kernel.org \
--cc=marius@trolltech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).