git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Beat Bolli <dev+git@drbeat.li>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] pretty: allow to override the built-in formats
Date: Sat, 5 Sep 2020 12:52:18 -0700	[thread overview]
Message-ID: <20200905195218.GA892287@generichostname> (raw)
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:
> 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?

> [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.

  reply	other threads:[~2020-09-05 19:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05 19:24 [PATCH] pretty: allow to override the built-in formats Beat Bolli
2020-09-05 19:52 ` Denton Liu [this message]
2020-09-06 21:59   ` Junio C Hamano
2020-09-07  5:36     ` Beat Bolli
2020-09-07  6:54       ` Junio C Hamano
2020-09-07  7:06         ` Beat Bolli
2020-09-08 13:53         ` Jeff King
2020-09-08 18:12           ` Junio C Hamano
2020-09-09  9:08             ` Jeff King
2020-09-09 18:27               ` Junio C Hamano

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20200905195218.GA892287@generichostname \
    --to=liu.denton@gmail.com \
    --cc=dev+git@drbeat.li \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).