git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Considering add log.format and show.format configure option
@ 2022-08-26  7:12 Zang
  2022-08-26  7:58 ` Jeff King
  2022-08-26 16:42 ` Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Zang @ 2022-08-26  7:12 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Considering add log.format and show.format configure option
  2022-08-26  7:12 Considering add log.format and show.format configure option Zang
@ 2022-08-26  7:58 ` Jeff King
  2022-08-26 16:42 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2022-08-26  7:58 UTC (permalink / raw)
  To: Zang; +Cc: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Considering add log.format and show.format configure option
  2022-08-26  7:12 Considering add log.format and show.format configure option Zang
  2022-08-26  7:58 ` Jeff King
@ 2022-08-26 16:42 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2022-08-26 16:42 UTC (permalink / raw)
  To: Zang; +Cc: git

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-26 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26  7:12 Considering add log.format and show.format configure option Zang
2022-08-26  7:58 ` Jeff King
2022-08-26 16:42 ` Junio C Hamano

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 NNTP newsgroup(s).