Subject: Re: [PATCH] Add `restore.defaultLocation` option

From: Junio C Hamano <[email-masked]>
Date: Mon, 13 Mar 2023 11:02:32 -0700

Junio C Hamano <[email-masked]> writes:

> "Hugo Sales via GitGitGadget" <[email-masked]> writes:
>
>> From: Hugo Sales <[email-masked]>
>>
>> This options allows control over which of `--worktree` or `--staged` is
>> applied when `git restore` is invoked with neither
>
> We do not want to do this.  Tutorials and documents will be written
> assuming the official default, ...

Well, I think this change is no different from any other
configuration option and it may be OK.

My initial reaction primarily came from the fact that the choice
between the index and the working tree is so fundamental aspect of
the behaviour of the command that people who wrote their script
would be relying on it not to change.  But given that the command is
still marked as experimental, as long as the new behaviour is
clearly documented to warn those who care *not* to rely on the
default behaviour and tell them to instead always give explicitly
these "--worktree" and/or "--staged" options, it would be OK.

This actually is a more important tangent, but if you think the
command invites mistakes from users who forget to give "--staged",
it may indicate that the command is too overloaded, and the UI might
be improved by removing the feature from this command and instead
encouraging people to use "git reset" to futz with the contents of
the index.  I dunno.