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

Re: [PATCH] pretty format string support for reflog times

From
Phil Pennock <phil@pennock-tech.com>
Date
Jul 27, 2016, 14:17 UTC
Message-ID
<1469629060.2278222.678276953.09D0768E@webmail.messagingengine.com>
In-Reply-To
<20160727135820.GC14928@sigill.intra.peff.net>
On Wed, Jul 27, 2016, at 09:58, Jeff King wrote:
Show 11 quoted lines
> 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

Coincidental, I was unaware of that. Sorry for the duplication. Please ignore my patch, I'm not going to even try to compete with Mr Ts'o.

I asked a friend who is a git developer why this wasn't available, he said it would be fairly easy to do, I asked if he was trying to suck me into contributing patches to git, he said yes. I neglected to search archives for myself.

Besides "two independent submissions in short space of time" as evidence that this functionality is wanted, my real-world motivator was: `go get $something` failed, until I told the Golang tooling to update dependencies too; after that I wanted to easily see when the dependency was last updated on my local system and ended up having to look at the reflog on disk and manually convert timestamps.

> To summarize, I think the conclusion there was that we would go with at
> least the 't' and 'r' formatters in the short term.

'r' and one of the non-relative renderers are the ones I put into a `[pretty]` item for my use.

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

Yes, I went for completeness even though it led to some duplication, and tested them all. Though it looks like I didn't include the --date modifications into the test-suite example. Oops.

Thanks for the review and the cluebat. -Phil

Previous: Jeff KingNext: Junio C Hamano
Message 4 of 20 in “pretty format string support for reflog times”
  1. pretty format string support for reflog timesPhil Pennock, Jul 27, 2016
  2. Phil PennockJul 27, 2016
  3. Jeff KingJul 27, 2016
  4. Phil PennockJul 27, 2016
  5. Junio C HamanoJul 27, 2016
  6. Jeff KingJul 27, 2016
  7. Junio C HamanoJul 27, 2016
  8. Jeff KingJul 27, 2016
  9. Junio C HamanoJul 27, 2016
  10. Jeff KingJul 27, 2016
  11. Jeff KingJul 27, 2016
  12. Phil PennockJul 27, 2016
  13. Jeff KingJul 27, 2016
  14. 0/2 t4205 style fixesJeff King, Jul 27, 2016
  15. 1/2 t4205: drop top-level &&-chainingJeff King, Jul 27, 2016
  16. 2/2 t4205: indent here documentsJeff King, Jul 27, 2016
  17. Junio C HamanoJul 27, 2016
  18. Jeff KingJul 27, 2016
  19. Phil PennockJul 27, 2016
  20. Jeff KingJul 27, 2016

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.