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

Re: [PATCH 3/5] doc/pretty-formats: describe index/time formats for %gd

From
Theodore Ts'o <tytso@mit.edu>
Date
Jul 11, 2016, 16:48 UTC
Message-ID
<20160711164834.GC3890@thunk.org>
In-Reply-To
<20160711050513.GC32514@sigill.intra.peff.net>
On Mon, Jul 11, 2016 at 01:05:13AM -0400, Jeff King wrote:
Show 6 quoted lines
> The "reflog selector" format changes based on a series of
> heuristics, and that applies equally to both stock "log -g"
> output, as well as "--format=%gd". The documentation for
> "%gd" doesn't cover this. Let's mention the multiple formats
> and refer the user back to the "-g" section for the complete
> rules.

Is it worth mentioning that the shortening only happens if the user specifies a selector with '/' in it in the first place? I was confused when I was first playing with these selectors because %gd and %gD are identical if you run

	git reflog --format=%gd -3 master
	git reflog --format=%gD -3 master
and are only different if you run:
	git reflog --format=%gd -3 refs/heads/master
	git reflog --format=%gD -3 refs/heads/master
					- Ted
					
Previous: Jeff KingNext: Jeff King
Message 10 of 18 in “pretty: add format specifiers: %gr, %gt, %gI, gi”
  1. pretty: add format specifiers: %gr, %gt, %gI, giTheodore Ts'o, Jul 10, 2016
  2. Jeff KingJul 10, 2016
  3. Theodore Ts'oJul 10, 2016
  4. Duy NguyenJul 10, 2016
  5. Theodore Ts'oJul 10, 2016
  6. Jeff KingJul 11, 2016
  7. 1/5 doc/rev-list-options: clarify "commit@{Nth}" for "-g" optionJeff King, Jul 11, 2016
  8. 2/5 doc/rev-list-options: explain "-g" output formatsJeff King, Jul 11, 2016
  9. 3/5 doc/pretty-formats: describe index/time formats for %gdJeff King, Jul 11, 2016
  10. Theodore Ts'oJul 11, 2016
  11. Jeff KingJul 12, 2016
  12. Junio C HamanoJul 12, 2016
  13. 4/5 date: document and test "raw-local" modeJeff King, Jul 11, 2016
  14. Theodore Ts'oJul 11, 2016
  15. Jeff KingJul 12, 2016
  16. 5/5 date: add "unix" formatJeff King, Jul 11, 2016
  17. Theodore Ts'oJul 11, 2016
  18. Junio C HamanoJul 11, 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.