Re: [PATCH] stash show: don't setup default diff output format if --{include,only}-untracked given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Denton Liu <liu.denton@xxxxxxxxx> 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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux