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

Re: pretty placeholders for reflog entries

From
Jeff King <peff@peff.net>
Date
Nov 7, 2011, 21:13 UTC
Message-ID
<20111107211325.GB7380@sigill.intra.peff.net>
In-Reply-To
<CAMYxyaWPWVGUHz0qQOnARb9wexHCx73a04Bu_UhrJR=xrinX7g@mail.gmail.com>
On Sun, Nov 06, 2011 at 11:49:48PM -0600, Jack Nagel wrote:
Show 9 quoted lines
> I have the reflog enabled on a bare repo so that I can have a record of
> "who pushed what, when". I'd like to define a custom pretty format for
> use with "git log -g" for reading it, but unfortunately the placeholders
> for reflog information are somewhat limited. In particular, I'd like to
> be able to access the identity (i.e., name and email) and date from each
> reflog entry.
> 
> Is it possible to extract this information in current git? Perhaps I
> overlooked something.

Sorry, but there aren't convenient placeholders for that. There probably should be.

As a workaround, you can get the reflog selector ("%gD"), and then cross-reference it with the output of "git log -g". But obviously that's inefficient and a giant pain. We really should have "%gn" and "%ge" for the reflog name and email. And related date options, though annoyingly "%gd" is already taken for the default format.

I doubt it would be a very big patch. Want to get your feet wet in git development? :)

-Peff
Previous: Jack NagelNext: Jack Nagel
Message 2 of 7 in “pretty placeholders for reflog entries”
  1. Jack NagelNov 7, 2011
  2. Jeff KingNov 7, 2011
  3. Jack NagelNov 7, 2011
  4. Jeff KingNov 7, 2011
  5. Junio C HamanoNov 7, 2011
  6. Jeff KingNov 8, 2011
  7. Jack NagelNov 10, 2011

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.