git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git reflog --date

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 21, 2014, 23:11 UTC
Message-ID
<xmqqk33thvbo.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAHQ6N+qkQbmhY-nueF28+iRhbVvH__gihXb6yyj3dRbgpbV18g@mail.gmail.com>
John Tapsell <johnflux@gmail.com> writes:
Show 30 quoted lines
> On 21 October 2014 19:06, Junio C Hamano <gitster@pobox.com> wrote:
>> John Tapsell <johnflux@gmail.com> writes:
>>
>>> For me, writing "git reflog @{now}"  is a lot less intuitive than "git
>>> reflog --date"
>>>
>>> Currently the top google search for this question is here:
>>>
>>> http://stackoverflow.com/questions/17369254/is-there-a-way-to-cause-git-reflog-to-show-a-date-alongside-each-entry
>>>
>>> Which doesn't mention "@{now}"   at all.
>>
>> I would say that a site where cluelesses attempt to lead other
>> cluelesses is not the best source of information ;-), but that tells
>> us that either our docs are not read by people or they do not give
>> necessary information to them clearly enough.
>>
>>> My opinion:
>>>
>>> 1. Add --date   as an option to reflog.  Perhaps using the log.date
>>> format as the default.
>>> 2. Document --date in the man page for "git reflog"
>>> 3. Document @{now}  in the man page for "git reflog"
>>>
>>> Sound good?
>>
>> The order of changes is questionable, but other than that, I think
>> that would be a good way forward.
>
> Great - now I just need to persuade someone very nice nicely.. :-)
You should note that #1 is unworkable, as it would make:
    $ git log -g --date default

ambiguous. Is it asking the timed reflog output using log.date format on the "default" branch, or is it asking the timed reflog output using the "default" time format on the HEAD?

You would need to disambiguate by
    $ git log -g --date -- default ;# on default branch
    $ git log -g --date default -- ;# using default time format

or something, which means --date can be the last dashed option on the command line, and also you close the door for us to ever add another dashed command line option that takes an optional argument.

So the best you could do is
    1. Add document commit@{timestamp} vs commit@{count} notation
       we have for "git log" also to "git reflog", perhaps?
    2. Document --date=<style> (but not --date alone) as a way to
       trigger timed output for reflog entries, and refer to that
       from "--walk-reflogs" option description as "see also".
 
Previous: John TapsellNext: Junio C Hamano
Message 6 of 8 in “git reflog --date”
  1. John TapsellOct 21, 2014
  2. Junio C HamanoOct 21, 2014
  3. John TapsellOct 21, 2014
  4. Junio C HamanoOct 21, 2014
  5. John TapsellOct 21, 2014
  6. Junio C HamanoOct 21, 2014
  7. Junio C HamanoOct 21, 2014
  8. Phil HordNov 4, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.