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

Re: [PATCH] pretty: allow to override the built-in formats

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 8, 2020, 18:12 UTC
Message-ID
<xmqqzh60xhms.fsf@gitster.c.googlers.com>
In-Reply-To
<20200908135303.GA2448968@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> You could accomplish something similar by having gitk look up
> pretty.userReference, and defaulting to something sensible if it's not
> defined. For a big script like gitk that's not too much of an
> imposition. But it's awfully convenient to be able to just say
> --format=reference in any script and get the user's preferred format.

Or --format=userReference in any script, and then allow it to fall back to pretty.reference that is otherwise ignored? Ah, that indeed is what you suggested with --format=loose:reference already.

> So of any of the formats, it seems like the most likely candidate for
> such a feature (setting "pretty.raw" would be a pretty big foot-gun, for
> instance). I don't like the inconsistency it introduces between formats,
> though.
Yes, the inconsistency was what primarily disturbed me.
Show 8 quoted lines
> Here's a slightly different proposal. I'm not sure if I like it or not,
> but just thinking out loud for a moment. The issue is that we're worried
> the consumer of the output may be surprised by a user-configured pretty
> format. Can we give them a way to say "I don't care about the exact
> output; pick what the user configured for this name, or some sane
> default". I.e., something like:
>
>   git log --format=loose:reference
Yeah, that, or with s/loose/user/ or something.
Previous: Jeff KingNext: Jeff King
Message 8 of 10 in “pretty: allow to override the built-in formats”
  1. pretty: allow to override the built-in formatsBeat Bolli, Sep 5, 2020
  2. Denton LiuSep 5, 2020
  3. Junio C HamanoSep 6, 2020
  4. Beat BolliSep 7, 2020
  5. Junio C HamanoSep 7, 2020
  6. Beat BolliSep 7, 2020
  7. Jeff KingSep 8, 2020
  8. Junio C HamanoSep 8, 2020
  9. Jeff KingSep 9, 2020
  10. Junio C HamanoSep 9, 2020

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.