Re: [PATCH v4 5/5] stash: implement builtin stash
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jun 26, 2017, 07:53 UTC
- Message-ID
- <vpqshini3r6.fsf@anie.imag.fr>
- In-Reply-To
- <20170625210909.GB7737@hank>
Thomas Gummerer <t.gummerer@gmail.com> writes:
Show 10 quoted lines
> After the line
>
> test -n "$seen_non_option" || set "push" "$@"
>
> it's not possible that $# is 0 anymore, so this will never be
> printed. From a quick look at the history it seems like it wasn't
> possible to trigger that codepath for a while. If I'm reading things
> correctly 3c2eb80fe3 ("stash: simplify defaulting to "save" and reject
> unknown options", 2009-08-18) seems to have introduced the small
> change in behaviour.Indeed. That wasn't on purpose, but I seem to have turned this
case $# in 0) push_stash && say "$(gettext "(To restore them type \"git stash apply\")")" ;;
into dead code.
> As I don't think anyone has complained since then, I'd just leave it > as is, which makes git stash with no options a little less verbose.
I agree it's OK to keep is as-is, but the original logic (give a bit more advice when "stash push" was DWIM-ed) made sense too, so it can make sense to re-activate it while porting to C.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/