git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: 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 09:27:30 -0500	[thread overview]
Message-ID: <20090220142730.GA32751@coredump.intra.peff.net> (raw)
In-Reply-To: <1235136252-29649-1-git-send-email-eletuchy@gmail.com>

On Fri, Feb 20, 2009 at 05:24:12AM -0800, eletuchy@gmail.com wrote:

>  - git config value blame.date that expects one of the git log date
>    formats ({relative,local,default,iso,rfc,short})

OK. I was concerned that this might muck with scripts, but it looks like
the --porcelain and --incremental codepaths are properly unaffected.
Good.

>  - git blame command line option --date-format expects one of the git
>    log date formats ({relative,local,default,iso,rfc,short})

Why not --date= ?

It is currently accepted by the revision option parsing, but not used;
you would just need to pull the value from revs.date_mode instead of
adding a new option.

> The tests pass. The mailmap test needed to be modified to expect iso
> formatted blames rather than the new "default".

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)).


All of that being said, I think there are two code issues to be dealt
with:

  1. There seems to be a bug. With your patch, running a simple test
     like:

       git blame --date-format=relative wt-status.c

     gives me relative output on some lines, and not on others. E.g.,
     the first 10 lines are:

85023577 (Junio C Hamano      Tue Dec 19 14:34:12 2006 -0800   1) #include "cache.h"
c91f0d92 (Jeff King           Fri Sep 8 04:05:34 2006 -0400   2) #include "wt-status.h"
c91f0d92 (Jeff King           Fri Sep 8 04:05:34 2006 -0400   3) #include "color.h"
c91f0d92 (Jeff King           Fri Sep 8 04:05:34 2006 -0400   4) #include "object.h"
c91f0d92 (Jeff King           Fri Sep 8 04:05:34 2006 -0400   5) #include "dir.h"
c91f0d92 (Jeff King           Fri Sep 8 04:05:34 2006 -0400   6) #include "commit.h"
c91f0d92 (Jeff King           Fri Sep 8 04:05:34 2006 -0400   7) #include "diff.h"
c91f0d92 (Jeff King           Fri Sep 8 04:05:34 2006 -0400   8) #include "revision.h"
c91f0d92 (Jeff King           Fri Sep 8 04:05:34 2006 -0400   9) #include "diffcore.h"
a734d0b1 (Dmitry Potapov      12 months ago  10) #include "quote.h"
ac8d5afc (Ping Yin            10 months ago  11) #include "run-command.h"
b6975ab5 (Junio C Hamano      8 months ago  12) #include "remote.h"
c91f0d92 (Jeff King           Fri Sep 8 04:05:34 2006 -0400  13)

  2. As you can see in the output above, there are potential alignment
     issues. The original date format had a fixed width, whereas
     arbitrary date formats can be variable. Obviously the mixture of
     relative and ISO dates makes it much worse, but even within an ISO
     date there are problems (e.g., "19" versus "8").

-Peff

  parent reply	other threads:[~2009-02-20 14:29 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 [this message]
2009-02-20 16:13   ` Eugene Letuchy
2009-02-20 17:18     ` Jeff King
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=20090220142730.GA32751@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).