From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Thomas Rast <trast@student.ethz.ch>
Subject: Re: 'git stash list' vs. non-default 'log.date' setting
Date: Tue, 10 Aug 2010 17:40:56 +0200 [thread overview]
Message-ID: <20100810154056.GA4252@neumann> (raw)
In-Reply-To: <7vbp9b96cm.fsf@alter.siamese.dyndns.org>
Hi,
On Mon, Aug 09, 2010 at 08:02:49AM -0700, Junio C Hamano wrote:
> SZEDER Gábor <szeder@ira.uka.de> writes:
>
> > Fortunately, fixing 2) is a no-brainer:
>
> I don't think it is a "no-brainer" to "fix" it, even though it may be so
> to hack it around. Having to give "--date=default" to "git log -g" to
> cause it to show reflog entries in non-date format sounds like a terrible
> UI bug to me. I'd expect
>
> $ git log -g --date=default
>
> to give you the logs in the default date format, overriding log.date
Indeed. I was just trying to get back the old behavior quickly and
with minimal effort, and didn't think about what the default date
format should actually mean.
> and perhaps either of these
>
> $ git log -g --no-date
> $ git log -g --date=no
> $ git log -g --numbered
>
> to countermand log.date and force it to show numbered entries.
It never occured to me before that that number in @{<num>} in reflogs
is actually kind of a date format. But since it seems to be the case,
a dedicated --date=<whatever> option for this format might be good to
have, although I don't think that this date format would be applicable
to regular logs.
> I _think_ "git log -g" uses a hacky heuristics to choose between date/number
> based on how you give the stating ref. I personally do not like this dwim
> very much, but it seems to be stable and established by now, so it may be
> a good thing to use here instead:
>
> $ git log -g refs/stash@{0}
> $ git log -g refs/stash@{now}
I see the DWIMery in this case, but 'git stash list' uses
reflog-specific format specifiers to generate the list of stashes:
git log --format="%gd: %gs" -g "$@" $ref_stash --
and unfortunately the %gd (and %gD) format specifier performs this
DWIMery only when log.date is not set, otherwise log.date takes over:
$ git config --get log.date
$ git log --format="%gd: %gs" -g refs/stash@{0}
stash@{0}: On master: foo
$ git log --format="%gd: %gs" -g refs/stash@{now}
stash@{2010-08-09 17:41:37 +0200}: On master: foo
$ git config log.date iso8601
$ git log --format="%gd: %gs" -g refs/stash@{0}
stash@{2010-08-09 17:41:37 +0200}: On master: foo
$ git log --format="%gd: %gs" -g refs/stash@{now}
stash@{2010-08-09 17:41:37 +0200}: On master: foo
Best,
Gábor
prev parent reply other threads:[~2010-08-10 15:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-09 10:40 'git stash list' vs. non-default 'log.date' setting SZEDER Gábor
2010-08-09 15:02 ` Junio C Hamano
2010-08-10 15:40 ` SZEDER Gábor [this message]
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=20100810154056.GA4252@neumann \
--to=szeder@ira.uka.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=trast@student.ethz.ch \
/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).