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
Junio C Hamano <gitster@pobox.com>
Date
Jul 12, 2016, 02:01 UTC
Message-ID
<xmqqtwfv7gxd.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160712000841.GB26163@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 35 quoted lines
> Maybe this on top of the other documentation patches?
>
> -- >8 --
> Subject: [PATCH] doc/pretty-formats: explain shortening of %gd
>
> The actual shortening rules aren't that interesting and
> probably not worth getting into (I gloss over them here as
> "shortened for human readability"). But the fact that %gD
> shows whatever you gave on the command line is subtle and
> worth mentioning. Since most people will feed a shortened
> refname in the first place, it otherwise makes it hard to
> understand the difference between the two.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  Documentation/pretty-formats.txt | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
> index 36a300a..b95d67e 100644
> --- a/Documentation/pretty-formats.txt
> +++ b/Documentation/pretty-formats.txt
> @@ -149,9 +149,12 @@ endif::git-rev-list[]
>  - '%GK': show the key used to sign a signed commit
>  - '%gD': reflog selector, e.g., `refs/stash@{1}` or
>    `refs/stash@{2 minutes ago`}; the format follows the rules described
> -  for the `-g` option
> -- '%gd': shortened reflog selector, e.g., `stash@{1}` or
> -  `stash@{2 minutes ago}`
> +  for the `-g` option. The portion before the `@` is the refname as
> +  given on the command line (so `git log -g refs/heads/master` would
> +  yield `refs/heads/master@{0}`).
> +- '%gd': shortened reflog selector; same as `%gD`, but the refname
> +  portion is shortened for human readability (so `refs/heads/master`
> +  becomes just `master`).
Sounds about the right amount of detail to me.  Thanks.
>  - '%gn': reflog identity name
>  - '%gN': reflog identity name (respecting .mailmap, see
>    linkgit:git-shortlog[1] or linkgit:git-blame[1])
Previous: Jeff KingNext: Jeff King
Message 12 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.