# Considering add log.format and show.format configure option

3 messages from 2022-08-26 to 2022-08-26. Participants: Zang, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/58363

## Zang, 2022-08-26 07:12

Subject: Considering add log.format and show.format configure option
Message-ID: <CAOrge3pTP5WU3Z1HRLz7xqExwt7_n33FUkh9KQP2m6VyuA9sJw@mail.gmail.com>
URL: https://gitlist.dev/e/CAOrge3pTP5WU3Z1HRLz7xqExwt7_n33FUkh9KQP2m6VyuA9sJw%40mail.gmail.com

```
Hi forks,

People including me are asking feature to use different format for log and show:

https://stackoverflow.com/questions/20579889/different-pretty-formats-for-git-log-and-git-show
https://stackoverflow.com/questions/37898232/make-different-pretty-settings-for-git-log-and-git-show

Can we consider add such option to git-config

[format]
    mylogformat = <...>
    myshowformat = <...>
[log]
    format = mylogformat
[show]
    format = myshowformat

Which should work same as

git log --format=mylogformat
git show --format=myshowformat

```

## Jeff King, 2022-08-26 07:58

Subject: Re: Considering add log.format and show.format configure option
Message-ID: <Ywh9LUOf9sNlVy4a@coredump.intra.peff.net>
URL: https://gitlist.dev/e/Ywh9LUOf9sNlVy4a%40coredump.intra.peff.net
In-Reply-To: <CAOrge3pTP5WU3Z1HRLz7xqExwt7_n33FUkh9KQP2m6VyuA9sJw@mail.gmail.com>

```
On Fri, Aug 26, 2022 at 03:12:34PM +0800, Zang wrote:

> Can we consider add such option to git-config
> 
> [format]
>     mylogformat = <...>
>     myshowformat = <...>
> [log]
>     format = mylogformat
> [show]
>     format = myshowformat
> 
> Which should work same as
> 
> git log --format=mylogformat
> git show --format=myshowformat

I don't think there is any reason not to add something like that. As you
note, we already allow overriding the default for all of the log-family
commands. So doing it for individual ones is not a stretch.

(I'm not sure if you know, the first half of your suggestion is already
available as pretty.*, so this would just be adding log.format, etc, to
override format.pretty. Possibly your "format' is just a typo of
"pretty" there).

-Peff

```

## Junio C Hamano, 2022-08-26 16:42

Subject: Re: Considering add log.format and show.format configure option
Message-ID: <xmqqh71zyn16.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqh71zyn16.fsf%40gitster.g
In-Reply-To: <CAOrge3pTP5WU3Z1HRLz7xqExwt7_n33FUkh9KQP2m6VyuA9sJw@mail.gmail.com>

```
Zang <zealot0630@gmail.com> writes:

> Hi forks,
>
> People including me are asking feature to use different format for log and show:
>
> https://stackoverflow.com/q...

We do not pay attention to SO, and it is good you came here.

> [log]
>     format = mylogformat
> [show]
>     format = myshowformat

I think something along this line was raised as a possible
enhancement on the list earlier.  If we were to do so, we should not
limit the enhancement only to "log/show" but to all the commands in
the "log" family, and similarly, not only to "format", but to many
common options.

Patches welcome.

Thanks.


```
