From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id C7E251F953 for ; Thu, 4 Nov 2021 02:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231975AbhKDCNp (ORCPT ); Wed, 3 Nov 2021 22:13:45 -0400 Received: from cloud.peff.net ([104.130.231.41]:52716 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230511AbhKDCNp (ORCPT ); Wed, 3 Nov 2021 22:13:45 -0400 Received: (qmail 6554 invoked by uid 109); 4 Nov 2021 02:11:08 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 04 Nov 2021 02:11:08 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 27416 invoked by uid 111); 4 Nov 2021 02:11:09 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Wed, 03 Nov 2021 22:11:09 -0400 Authentication-Results: peff.net; auth=none Date: Wed, 3 Nov 2021 22:11:06 -0400 From: Jeff King To: Junio C Hamano Cc: Dongsheng Song , Git Mailing List Subject: Re: [PATCH] strbuf_addftime(): handle "%s" manually Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Nov 03, 2021 at 01:28:00PM -0700, Junio C Hamano wrote: > I think this also needs squashing in? > > Documentation/rev-list-options.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git c/Documentation/rev-list-options.txt w/Documentation/rev-list-options.txt > index 24569b06d1..43a86fa562 100644 > --- c/Documentation/rev-list-options.txt > +++ w/Documentation/rev-list-options.txt > @@ -1047,7 +1047,7 @@ omitted. > has no effect. > > `--date=format:...` feeds the format `...` to your system `strftime`, > -except for %z and %Z, which are handled internally. > +except for %s, %z, and %Z, which are handled internally. > Use `--date=format:%c` to show the date in your system locale's > preferred format. See the `strftime` manual for a complete list of > format placeholders. When using `-local`, the correct syntax is Ah, thanks. I didn't even think to look in the documentation, because I didn't imagine that we would expose these implementation details. But since we do mention %z there, I think adding %s makes sense. BTW, I also noticed that stftime supports some locale modifiers. So "%Es" ends up printing the epoch seconds, but eludes our manual intervention (and so does the old, wrong thing). I'm fine with stopping here, though. There's no reason to use %Es over %s (from what I gather, the %E is about handling year eras for locales that support them, but that's meaningless for an epoch time), and I'm not sure it is even a portable thing (glibc does not mention it in the manpage along with other %E values, but it does work; POSIX does not even define %s, so of course does not mention %Es). -Peff