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

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

From
Denton Liu <liu.denton@gmail.com>
Date
Sep 5, 2020, 19:52 UTC
Message-ID
<20200905195218.GA892287@generichostname>
In-Reply-To
<20200905192406.74411-1-dev+git@drbeat.li>
Hi Beat,

Thanks for doing this. It was on my todo list but I've been quite busy recently.

On Sat, Sep 05, 2020 at 09:24:06PM +0200, Beat Bolli wrote:
Show 17 quoted lines
> In 1f0fc1db8599 (pretty: implement 'reference' format, 2019-11-19), the
> "reference" format was added. As a built-in format, it cannot be
> overridden, although different projects may have divergent conventions
> on how to format a commit reference. E.g., Git uses
> 
>     <hash> (<subject>, <short-date>) [1]
> 
> while Linux uses
> 
>     <hash> ("<subject>") [2]
> 
> Teach pretty to look at a different set of config variables, all
> starting with "override" (e.g. "pretty.overrideReference"), to override
> the built-in formats. Note that a format called "override" by itself is
> not affected. The prefix was chosen to make it clear to the user that
> this should not be done without thought, as it may cause issues with
> other tools that expect the built-in formats to be immutable.

Hmm, I'm not sure how I feel about being able to override formats other than "reference". Perhaps we could special-case "reference" instead of providing users with a possible foot-gun?

Show 9 quoted lines
> [1] https://github.com/git/git/blob/3a238e539bcdfe3f9eb5010fd218640c1b499f7a/Documentation/SubmittingPatches#L144
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v5.9-rc3#n167
> 
> Signed-off-by: Beat Bolli <dev+git@drbeat.li>
> ---
> I intend to also submit a patch to gitk that will use "git show -s
> --pretty=reference" if it is available, with a fallback to reading
> "pretty.overrideReference", so there's a single point of configuration
> for the reference format.
Very good, I'm in favour of this.
Previous: Beat BolliNext: Junio C Hamano
Message 2 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.