All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Karszniewicz <avoidr@posteo.de>
To: Derrick Stolee <stolee@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH] log: add log.showStat configuration variable
Date: Sun, 11 Oct 2020 11:59:16 +0200	[thread overview]
Message-ID: <20201011095916.GA14933@HP> (raw)
In-Reply-To: <bec999ef-5f9c-0ca1-ddd9-70b54b8c51b1@gmail.com>

On Thu, Oct 08, 2020 at 02:12:50PM -0400, Derrick Stolee wrote:
> On 10/8/2020 12:20 PM, Robert Karszniewicz wrote:
> > 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?

I answered this in the reply to Junio C Hamano.

Actually, the first thing I tried, was make an alias named after the git
command, like so:

  git config --global alias.show "show --stat"
  git config --global alias.log "log --stat"

But that didn't work. Why, actually? We're used to it from our POSIX
shells, and other places I can't think of, but it feels familiar.
Perhaps this would be a good way to enable changing default behaviour of
each git command without having to change anything about config
handling? Would this be difficult to do?

> 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:

I worried about that, too. But I think the initial step was already in
2015, when stash.showStat and stash.showPatch were added. No flood of
options happened since then? I was actually surprised about it, too,
that it took so long until someone wanted to have showStat for show and
log, too.

> 
>  1. aliases exist, and
>  2. it becomes unclear which arguments have configured defaults.
> 
> Thanks,
> -Stolee
> 

Thank you!

  reply	other threads:[~2020-10-11  9:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 16:20 [RFC PATCH] log: add log.showStat configuration variable Robert Karszniewicz
2020-10-08 17:58 ` Junio C Hamano
2020-10-10 14:02   ` Robert Karszniewicz
2020-10-08 18:12 ` Derrick Stolee
2020-10-11  9:59   ` Robert Karszniewicz [this message]
2020-10-12 12:50     ` Derrick Stolee
2020-10-12 16:14       ` 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

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

  git send-email \
    --in-reply-to=20201011095916.GA14933@HP \
    --to=avoidr@posteo.de \
    --cc=git@vger.kernel.org \
    --cc=stolee@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.