git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Phil Pennock <phil@pennock-tech.com>
Cc: Theodore Ts'o <tytso@mit.edu>,
	git@vger.kernel.org,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH] pretty format string support for reflog times
Date: Wed, 27 Jul 2016 09:58:20 -0400	[thread overview]
Message-ID: <20160727135820.GC14928@sigill.intra.peff.net> (raw)
In-Reply-To: <20160727081414.GA21451@breadbox>

On Wed, Jul 27, 2016 at 04:14:14AM -0400, Phil Pennock wrote:

> The reflog contains timestamp information, but these were not exposed to
> `--pretty`.  Four of the six author/committer format string
> second-letters were still available and copied, but `d`/`D` are taken
> for reflog selector formatting.  So use `%gT` for "time" instead of
> "date" mnemonic for using `--date=...` formatting.

Hrm. Since Ted was not cc'd, it is not clear to me whether this is
coincidental or in response to the thread over in

  http://thread.gmane.org/gmane.comp.version-control.git/299201

To summarize, I think the conclusion there was that we would go with at
least the 't' and 'r' formatters in the short term. The 'i/I' ones were
not something Ted cared about that much, I think, but they do make
things orthogonal with the other ident dates.

Your '%gT' seems like a nice idea in principle, though I'm not sure it
is all that useful due to the way that --date impacts %gd.  In other
words:

  git log -g --format=%gd --date=rfc

will already respect --date (albeit with "ref@{...}" wrapped around it).
But even with your patch, you cannot do:

  git log -g --format="%gd %gT" --date=rfc

to get "HEAD@{0} ...rfc-date...", because the presence of "--date" is
the trigger to switch the meaning of "%gd".

So the final solution is more like:

  - a formatter for just the reflog time, respecting date

  - a formatter for just the reflog index (the "0" in HEAD@{0})

  - a formatter for the ref name (just the "HEAD" in HEAD@{0})

And I'm not sure if we want to do that now with a bunch of arcane
two-letter placeholders, or wait for a refactoring where they can get
more readable names like %(reflog-index).

-Peff

  parent reply	other threads:[~2016-07-27 13:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27  8:14 [PATCH] pretty format string support for reflog times Phil Pennock
2016-07-27 12:02 ` Phil Pennock
2016-07-27 13:58 ` Jeff King [this message]
2016-07-27 14:17   ` Phil Pennock
2016-07-27 17:18   ` Junio C Hamano
2016-07-27 17:39     ` Jeff King
2016-07-27 18:09       ` Junio C Hamano
2016-07-27 18:17         ` Jeff King
2016-07-27 17:46     ` Junio C Hamano
2016-07-27 17:58       ` Jeff King
2016-07-27 17:56 ` Jeff King
2016-07-27 18:13   ` Phil Pennock
2016-07-27 18:32     ` Jeff King
2016-07-27 18:41       ` Phil Pennock
2016-07-27 19:16         ` Jeff King
2016-07-27 18:52       ` [PATCH 0/2] t4205 style fixes Jeff King
2016-07-27 18:55         ` [PATCH 1/2] t4205: drop top-level &&-chaining Jeff King
2016-07-27 18:55         ` [PATCH 2/2] t4205: indent here documents Jeff King
2016-07-27 19:28           ` Junio C Hamano
2016-07-27 19:57             ` Jeff King

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=20160727135820.GC14928@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=phil@pennock-tech.com \
    --cc=tytso@mit.edu \
    /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).