list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <>
To: ZheNing Hu via GitGitGadget <>
Cc:, "René Scharfe" <>,
	"Junio C Hamano" <>,
	"Linus Torvalds" <>,
	"ZheNing Hu" <>
Subject: Re: [PATCH] [GSOC] pretty: provide human date format
Date: Fri, 23 Apr 2021 16:21:13 -0400	[thread overview]
Message-ID: <YIMsOV/O2Ss+qaeK@nand.local> (raw)
In-Reply-To: <>

Hi ZheNing,

On Fri, Apr 23, 2021 at 04:27:25PM +0000, ZheNing Hu via GitGitGadget wrote:
> From: ZheNing Hu <>
> Add the placeholders %ah and %ch to format author date and committer
> date, like --date=human does, which provides more humanity date output.

I don't see a reason why this shouldn't exist, and the patch that you
wrote below looks pretty good to me.

To refresh my memory on if you had missed any spots, I followed
0df621172d (pretty: provide short date format, 2019-11-19) as an
example. You did a fine job here, and I don't think this patch is
missing anything.

> Signed-off-by: ZheNing Hu <>
> ---
>     [GSOC] pretty: provide human date format
>     Reasons for making this patch: --date=human has no corresponding
>     --pretty option.
>     Although --date=human with --pretty="%(a|c)d" can achieve the same
>     effect with --pretty="%(a|c)h", but it can be noticed that most time
>     formats implement the corresponding option of --pretty, such as
>     --date=iso8601 can be replaced by --pretty=%(a|c)i, so add
>     "--pretty=%(a|c)h" seems to be a very reasonable thing.

Just to make sure I understand what you wrote: you're saying that the
pretty formats "%ah" and "%ch" that you propose here could be achieved
with --date=human and --pretty="%ad". Makes sense, but I agree that your
point about --date=iso8601 having a built-in pretty atom makes the case
for having "%ah" and "%ch".

> Published-As:
> Fetch-It-Via: git fetch pr-939/adlternative/pretty_human-v1
> Pull-Request:
>  Documentation/pretty-formats.txt | 2 ++
>  pretty.c                         | 3 +++
>  t/    | 6 ++++++
>  3 files changed, 11 insertions(+)
> diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
> index 45133066e412..9cdcdb8bb414 100644
> --- a/Documentation/pretty-formats.txt
> +++ b/Documentation/pretty-formats.txt
> @@ -190,6 +190,7 @@ The placeholders are:
>  '%ai':: author date, ISO 8601-like format
>  '%aI':: author date, strict ISO 8601 format
>  '%as':: author date, short format (`YYYY-MM-DD`)
> +'%ah':: author date, human style

There's no sorting here, so this place (at the bottom of the author-date
placeholders) seems just as good as any.

>  '%cn':: committer name
>  '%cN':: committer name (respecting .mailmap, see
>  	linkgit:git-shortlog[1] or linkgit:git-blame[1])
> @@ -206,6 +207,7 @@ The placeholders are:
>  '%ci':: committer date, ISO 8601-like format
>  '%cI':: committer date, strict ISO 8601 format
>  '%cs':: committer date, short format (`YYYY-MM-DD`)
> +'%ch':: committer date, human style

Likewise. The rest all looks good to me, too.

  Reviewed-by: Taylor Blau <>


  reply	other threads:[~2021-04-23 20:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 16:27 ZheNing Hu via GitGitGadget
2021-04-23 20:21 ` Taylor Blau [this message]
2021-04-24 13:26   ` ZheNing Hu
2021-04-23 21:10 ` Philip Oakley
2021-04-24 13:33   ` ZheNing Hu
2021-04-24 14:42 ` [PATCH v2] " ZheNing Hu via GitGitGadget
2021-04-24 19:44   ` Philip Oakley
2021-04-25  9:11   ` [PATCH 0/2] pretty tests: --date/format test improvements Ævar Arnfjörð Bjarmason
2021-04-25  9:11     ` [PATCH 1/2] pretty tests: simplify %aI/%cI date format test Ævar Arnfjörð Bjarmason
2021-04-26 21:22       ` Beat Bolli
2021-04-27  7:08       ` Junio C Hamano
2021-04-25  9:11     ` [PATCH 2/2] pretty tests: give --date/format tests a better description Ævar Arnfjörð Bjarmason
2021-04-25  9:30       ` ZheNing Hu
2021-04-25 10:41   ` [PATCH v3] [GSOC] pretty: provide human date format ZheNing Hu via GitGitGadget
2021-05-03 15:37     ` [PATCH v4] " ZheNing Hu via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YIMsOV/O2Ss+qaeK@nand.local \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] [GSOC] pretty: provide human date format' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ \
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for project(s) associated with this inbox:

AGPL code for this site: git clone