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

Re: 'git stash push -- {dir}' puts files in stash that are outside of {dir}

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 26, 2023, 18:14 UTC
Message-ID
<xmqqo7jyczgj.fsf@gitster.g>
In-Reply-To
<792f71bb-2b9a-2e2b-80ea-9e3afd9fbfb4@tsoft.com>
Yuri <yuri@tsoft.com> writes:
Show 8 quoted lines
> On 7/26/23 10:29, Junio C Hamano wrote:
>> Are there configuration variables set to affect the behaviour of the
>> "git stash" command in your environment that I do not have (I have
>> nothing in "git config -l | grep stash" output), which may be
>> affecting why it does not reproduce for me?
>
>
> "git config -l | grep stash" doesn't print anything.

Another thing to try. The command internally uses some internal form of "git diff" to find out what to save and reset to the HEAD version in the working tree, so if you have an exotic configuration variable that affects the way "diff" behaves, it _could_ trigger a symptom like that (needless to say, the internal invocation of "git diff" should have prepared for such an end-user configuration and explicitly countermanded it, but people add configuration variables after a command was implemented without thinking the ramification through and especially when they are rarely used ones that do not usually appear on Git developers' radar, such a bad interaction can go unnoticed for a long time).

Previous: Yuri
Message 4 of 4 in “'git stash push -- {dir}' puts files in stash that are outside of {dir}”
  1. YuriJul 26, 2023
  2. Junio C HamanoJul 26, 2023
  3. YuriJul 26, 2023
  4. Junio C HamanoJul 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.