git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Denton Liu <liu.denton@gmail.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 10:25:30 +0900	[thread overview]
Message-ID: <xmqq35uj1pmd.fsf@gitster.g> (raw)
In-Reply-To: <76dfa90a32ae926f7477d5966109f81441eb2783.1621325684.git.liu.denton@gmail.com> (Denton Liu's message of "Tue, 18 May 2021 01:15:38 -0700")

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.


  reply	other threads:[~2021-05-19  1:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18  8:15 Denton Liu
2021-05-19  1:25 ` Junio C Hamano [this message]
2021-05-19  9:23   ` Denton Liu
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

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

  git send-email \
    --in-reply-to=xmqq35uj1pmd.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.com \
    --cc=sunshine@sunshineco.com \
    --subject='Re: [PATCH] stash show: don'\''t setup default diff output format if --{include,only}-untracked given' \
    /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

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).