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

Re: [RFC PATCH] log: add log.showStat configuration variable

From
Derrick Stolee <stolee@gmail.com>
Date
Oct 8, 2020, 18:12 UTC
Message-ID
<bec999ef-5f9c-0ca1-ddd9-70b54b8c51b1@gmail.com>
In-Reply-To
<20201008162015.23898-1-avoidr@posteo.de>
On 10/8/2020 12:20 PM, Robert Karszniewicz wrote:
Show 8 quoted lines
> Changes default behaviour of `git log` and `git show` when no
> command-line options are given. Doesn't affect behaviour otherwise (same
> behaviour as with stash.showStat).
> ---
> I've wanted to have `show` and `log` show --stat by default, and I
> couldn't find any better solution for it. And I've discovered that there
> is stash.showStat, which is exactly what I want. So I wanted to bring
> stash.showStat to `show` and `log`.

I'm wondering: why should this be a config setting instead of just a configure alias?

	git config --global alias.logs "log --stat"
 
My personal preference is to use "--graph --oneline" by default, so
I use
	git config --global alias.lg "log --graph --oneline"

and then type "git lg ..." whenever I'm looking at history. I also have an easy way to turn off the graph by using just "git log" when I want that disabled.

Show 8 quoted lines
> So far, setting log.showStat affects behaviour as described in the
> commit message.
> But it does so for `show` and `log` at the same time. I think they
> should be configurable separately. (log.showStat and show.showStat)
> 
> Before I do all the work, please tell me if this is the right approach
> so far, and if the feature - when ready - would be accepted. (I'm aware
> that documentation and tests are missing.)

If this is something we want to do as a config instead of alias, I'm wondering if it is worth expanding the scope and thinking about these other arguments (like --graph, --oneline, etc.) and how they could be incorporated into a coherent config system.

I worry that this initial step leads us down a road of slowly adding one-off config settings for each option when:

 1. aliases exist, and
 2. it becomes unclear which arguments have configured defaults.

Thanks, -Stolee

Previous: Robert KarszniewiczNext: Robert Karszniewicz
Message 4 of 7 in “log: add log.showStat configuration variable”
  1. log: add log.showStat configuration variableRobert Karszniewicz, Oct 8, 2020
  2. Junio C HamanoOct 8, 2020
  3. Robert KarszniewiczOct 10, 2020
  4. Derrick StoleeOct 8, 2020
  5. Robert KarszniewiczOct 11, 2020
  6. Derrick StoleeOct 12, 2020
  7. Junio C HamanoOct 12, 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.