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

Re: [PATCH 0/2] Use %as and %cs as pretty format flags

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 28, 2008, 23:36 UTC
Message-ID
<7viqtkd84s.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080828231547.GD29609@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 20 quoted lines
> On Thu, Aug 28, 2008 at 06:09:37AM -0500, Nathan Panike wrote:
>
>> The patch series below allows git to use %as and %cs as flags for
>> pretty-printing the format of a date.
>
> Your description leaves a little to be desired (here and in the patches
> themselves). I had to read the patch to figure out that these are
> formatting specifiers for the date format "short".
>
> That being said, I think this is probably reasonable just for the sake
> of completeness (and I doubt we are wasting a useful formatting combo,
> since %a* is likely to remain dedicated to author information). I wonder
> if there should be "%al" for "local".
>
> However, it makes me wonder even more if '%ad' should simply respect the
> --date= parameter (this wouldn't allow you to mix and match dates in a
> single format, but I don't think that is what is desired). Or whether we
> should have some syntax for "%ad(short)" or something, where the
> argument would be handed off to the date format parser. But that is
> probably overengineering.

I was actually thinking about rejecting this, asking for something that allows to express all the other %[ai][dDri] format can express, and perhaps more. So I think "%ad(short)" is a good direction to go, except that 'd' is already taken. Perhaps %a(date), %a(shortdate,local),...?

Oh, and before anybody asks, even if we do %a(specifier), you can keep writing "%ad" if you are used to it. I am not talking about deprecating the existing ones, but making future extensions easier without forcing people to remember cryptic one-letter format specifiers.

Previous: Jeff KingNext: Jeff King
Message 3 of 9 in “Use %as and %cs as pretty format flags”
  1. 0/2 Use %as and %cs as pretty format flagsNathan Panike, Aug 28, 2008
  2. Jeff KingAug 28, 2008
  3. Junio C HamanoAug 28, 2008
  4. Jeff KingAug 28, 2008
  5. Nathan W. PanikeAug 29, 2008
  6. Jeff KingAug 29, 2008
  7. Junio C HamanoAug 29, 2008
  8. Jakub NarebskiAug 29, 2008
  9. Avery PennarunAug 29, 2008

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.