git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [PATCH] stash show: don't setup default diff output format if --{include,only}-untracked given
Date: Wed, 19 May 2021 02:23:44 -0700	[thread overview]
Message-ID: <YKTZIOOe+IW41MXp@generichostname> (raw)
In-Reply-To: <xmqq35uj1pmd.fsf@gitster.g>

Hi Junio,

On Wed, May 19, 2021 at 10:25:30AM +0900, Junio C Hamano wrote:
> Denton Liu <liu.denton@gmail.com> writes:
> 
> > When `git stash show` is given no arguments, it will pass `--stat` to
> > `git diff` by default. When any argument is given, `--stat` is no longer
> > passed by default.
> >
> > When `git stash show` learned the `--include-untracked` and
> > `--only-untracked` options, it failed to retain the same behaviour of
> > not passing `--stat` by default.
> >
> > This isn't necessarily incorrect since with other arguments, they're
> > passed through directly to `git diff` which means it wouldn't make sense
> > to pass `--stat` as well. With `--include-untracked` and
> > `--only-untracked`, they are handled by `git stash show` directly
> > meaning we don't necessarily have this conflict. However, this would be
> > unintuitive for users since the existing behaviour seems to be that if
> > any arguments are given, `--stat` will not be given by default.
> 
> But even for users who do not care about the implementation, the
> options that affect "What to show" and "How to show them" are easily
> distinguishable at the conceptual level, no?  When showing stash
> without telling the command what or how to show, we omit untracked
> part by default, and we show only diffstat by default.  When we tell
> it to show also/only untracked, it is unclear if it is confusing or
> natural to average users if that affects how the chosen part of the
> stash gets shown.
> 
> Showing untracked will be a new feature in the upcoming release, so
> we may want to either (1) revert the whole thing before we can agree
> on the desired behaviour or (2) clarify in the document that what to
> show and how to show them are two orthogonal axes with their own
> default that are orthogonal to avoid the "confusion" you are trying
> to address with this patch.

I could be convinced either way and I was erring on the side of caution
by proposing this patch. I'm okay with the status quo so we can keep the
behaviour as is, unless someone objects in which case we should revert
pending more discussion.

I'll send a follow-up patch later this week clarifying the docs.

Thanks,
Denton

  reply	other threads:[~2021-05-19  9:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18  8:15 [PATCH] stash show: don't setup default diff output format if --{include,only}-untracked given Denton Liu
2021-05-19  1:25 ` Junio C Hamano
2021-05-19  9:23   ` Denton Liu [this message]
2021-05-19 22:17     ` 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=YKTZIOOe+IW41MXp@generichostname \
    --to=liu.denton@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.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).