git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 13, 2023, 18:02 UTC
Message-ID
<xmqqfsa8v8av.fsf@gitster.g>
In-Reply-To
<xmqqfsa9y7t5.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
> "Hugo Sales via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> From: Hugo Sales <hugo@hsal.es>
>>
>> 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.

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “Add `restore.defaultLocation` option”
  1. Add `restore.defaultLocation` optionHugo Sales via GitGitGadget, Mar 11, 2023
  2. Junio C HamanoMar 12, 2023
  3. Junio C HamanoMar 13, 2023
  4. Junio C HamanoMar 13, 2023
  5. Hugo SalesMar 14, 2023
  6. Hugo SalesMar 26, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.