All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Phil Pennock <phil@pennock-tech.com>,
	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 11:09:30 -0700	[thread overview]
Message-ID: <xmqqfuqvvtph.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160727173915.GA32219@sigill.intra.peff.net> (Jeff King's message of "Wed, 27 Jul 2016 13:39:15 -0400")

Jeff King <peff@peff.net> writes:

> I actually think Phil's patch from today is a little cleaner for most of
> these, as it returns the values via out-parameters, and uses the return
> value for "did we get anything?".

True.  That part of the interface is indeed better done with the new
one.

I am still in favor of this suggestion you earlier made:

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

though.  After all we only need three short ones while we migrate
away to a longer %(reflog:<what>) format, right?

As to the unfortunate %gd that squats on the "date" other specifiers
use, I do not see a good/quick approach to migrate it.  If our ideal
short-term endgame before the longer format were to use %gd, %g# and
%gg for the above three, we first start warning people who use %gd
for the historical mistaken "reflog selector", while telling people
to use "%gg@{%g#}" instead if they truly want "reflog selector", and
then switch its meaning to "reflog date".  That would take a long
time.

As %r prefix is not taken, we can immediately deprecate %g-anything
format as a historical mistake and make sure we do not repeat the
mistake of giving "d" to "reflog selector", perhaps?

  reply	other threads:[~2016-07-27 18:09 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
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 [this message]
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=xmqqfuqvvtph.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.