git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Beat Bolli <dev+git@drbeat.li>
Cc: Denton Liu <liu.denton@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] pretty: allow to override the built-in formats
Date: Sun, 06 Sep 2020 23:54:42 -0700	[thread overview]
Message-ID: <xmqqtuwa13gt.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <8bb68268-8e4c-749e-b2e0-21b38b70c8bf@drbeat.li> (Beat Bolli's message of "Mon, 7 Sep 2020 07:36:47 +0200")

Beat Bolli <dev+git@drbeat.li> writes:

> On 06.09.20 23:59, Junio C Hamano wrote:
>> Denton Liu <liu.denton@gmail.com> writes:
>> 
>>> Hmm, I'm not sure how I feel about being able to override formats other
>>> than "reference".
>> 
>> Is the idea to introduce a parallel namespace to pretty.<name>?  I
>> am not sure why that is a good idea than, say a single variable that
>> says "to me, pretty.<name> would override even the built-in names".
>> 
>> I am not sure how I feel about being able to override built-in
>> formats in the first place, though.
>> 
>> After all, pretty.<name> were introduced so that user-defined ones
>> can be invoked with an equal ease as the built-in ones, but
>> overriding common understanding among the users of the tool is a
>> different story.
>
> I gave a reason for the reference format, at least.
>
> Would you be fine with a patch that just allows to override the
> reference format (for the stated reasons)?

Your "reason" read pretty much the same as "I want reference to do
something else", but that leads to "depending on the configuration,
even built-in names that are well known to all Git users behave
differently---the users lose common reference (no pun intended)".

Also I am not sure how your reason applies specifically to the
reference format.  It would be widely applicable to other formats
like 'short' and 'oneline' in that depending on projects' and
personal preference, people may want "something like X but not
exactly X" for all the built-in formats.

IOW I still do not see why your "stated reasons" justify overriding
any built-in format, and/or overriding only the reference format.  I
can understand (but not necessarily agree with) the position "We'll
let any built-in format to be overridden", but I do not see what
makes "reference" so special.  Even though I think it would confuse
the users to make any built-in format overridable and therefore I do
not think it is such a good idea, if we were to allow it, I do not
see any point in limiting the damage only to the reference format.

Finally, a non-built-in name to express the format specific to a
project can already be defined and used pretty easily; e.g. the
"pretty.kernel" format may say %h ("%s") and can be used like

    $ git show -s --pretty=kernel HEAD

with the same ease as the 'reference' format.

    $ git show -s --pretty=reference HEAD

So, I dunno.


  reply	other threads:[~2020-09-07  6:54 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
2020-09-06 21:59   ` Junio C Hamano
2020-09-07  5:36     ` Beat Bolli
2020-09-07  6:54       ` Junio C Hamano [this message]
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=xmqqtuwa13gt.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=dev+git@drbeat.li \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.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).