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, 17:24 UTC
Message-ID
<xmqqh9yx1gkt.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAHQ6N+oQV8Uesv_eCBZc+hpwR5rDWA22OXR05AJ_zXcf7bfQ7g@mail.gmail.com>
John Tapsell <johnflux@gmail.com> writes:
Show 8 quoted lines
> Hi all,
>
>   Could we add a default to "--date" so that:
>
> git reflog --date
>
> just works?  (Currently you need to do:   git reflog --date=iso)  It
> should probably obey the default in log.date?

Hmph. "--date=<style>" is not the way to choose between timed and counted output in the first place, though.

In a similar way that "git log -g @{now}" and "git log -g @{0}" switch between two, "git reflog @{now}" and "git reflog @{0}" have been the primary way to choose between them. Only because it is clear that you want the timed format when you specify any date style e.g. "git reflog --date=relative", we give timed output without @{<time>/<number>} but that is just icing on the cake.

That at least is why things are the way they are. And once you understand the above, you would understand why "--date=<style>" is not singled out as a useful option in the documentation, because that is not a primary way to choose between timed and counted output, but because it is merely a way to influence how times are shown once you chose timed output.

Having said all that, I have a few comments:
 - Perhaps use of @{<time>} vs @{<count>} as _the_ way to choose
   between timed and counted output is not documented clearly enough
   to lead to such a misunderstanding?
 - Perhaps use of @{<time>} vs @{<count>} is a less intuitive than
   ideal way to choose between them in the first place?
 - Perhaps adding --date with no date-style specification as another
   way to trigger "You said 'date' so you must mean you want timed
   output" heuristics just like existing "--date=<style>" does may
   let us get away without answering the above two questions,
   sidestepping the issues?
I dunno.
Previous: John TapsellNext: John Tapsell
Message 2 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.