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

Re: [PATCH] builtin/stash: configs keepIndex, includeUntracked

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 20, 2024, 02:52 UTC
Message-ID
<xmqq34tnyhhf.fsf@gitster.g>
In-Reply-To
<99346639-5a36-4c2e-a5d7-035c3c1fda8b@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 5 quoted lines
> How does "stash.keepIndex" interact with "git rebase --autostash" and
> "git merge --autostash"? I think both those commands expect a clean
> index after running "git stash". They could just override the config
> setting but it might get a bit confusing if some commands respect the
> config and others don't.

The "autostash" feature fundamentally should not respect such configuration variables, as the reason why they exist is not to create a stash of any unusual kind the user expresses preference to by the configuration variable(s), but to clear the slate and bring both the working tree and the index pristine with respect to HEAD. Also, when able, they would automatically unstash after the main operation to rebase or merge is done, right? IOW, normally the use of the stash ought to be invisible to the end users. I would not worry too much about the "confusion" factor for these reasons.

You are however right that this will confuse the toolchain. These two commands we provide may not be affected (or we can make them not affected by changing their implementation if needed, while we add such configuration variables at the same time), but third-party tools and end-user scripts that has trusted that when they write "git stash", the command will give them a clean index and working tree will be broken big time.

So, I am somewhat negative on the patch in the current form, until I see how the plan to help third-party tools and end-user scripts that rely on the promise we have given them looks like.

Thanks.
Previous: Junio C HamanoNext: Ricardo C
Message 10 of 16 in “builtin/stash: configs keepIndex, includeUntracked”
  1. builtin/stash: configs keepIndex, includeUntrackedMithicSpirit, Feb 18, 2024
  2. Phillip WoodFeb 18, 2024
  3. Ricardo CFeb 18, 2024
  4. Phillip WoodFeb 20, 2024
  5. Junio C HamanoFeb 20, 2024
  6. Ricardo CFeb 21, 2024
  7. Junio C HamanoFeb 21, 2024
  8. Ricardo CFeb 21, 2024
  9. Junio C HamanoFeb 21, 2024
  10. Junio C HamanoFeb 20, 2024
  11. Ricardo CFeb 20, 2024
  12. Junio C HamanoFeb 20, 2024
  13. Ricardo CFeb 20, 2024
  14. Kristoffer HaugsbakkFeb 20, 2024
  15. Jean-Noël AvilaFeb 19, 2024
  16. Ricardo CFeb 19, 2024

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.