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

Re: [PATCH v2] stash: honor --no-overwrite-ignore with --all

From
Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Date
Feb 3, 2026, 18:18 UTC
Message-ID
<20260203181845.602979-1-pushkarkumarsingh1970@gmail.com>
In-Reply-To
<CABPp-BEZkhYW+fWgtGn8yHuLfak+UYo9A_HwdiCkAf5A0H6hBA@mail.gmail.com>
Hi Elijah,
Thanks for the detailed feedback. Much appreciated.
> What's the basis for this patch? I don't see any "overwrite-ignore"
> anywhere in builtin/stash.c .

The basis was the existing behavior where git stash push -a would remove ignored files even when --no-overwrite-ignore is provided. The intent was to make stash honor --no-overwrite-ignore consistently with other callers of unpack_trees, limited specifically to the stash -a cleanup path.

In v3 I rebased onto current master and also removed the commit message claim about removing the stash FIXME, since this series only addresses the concrete stash behavior and does not attempt to solve the broader unpack_trees issues.

> This suggests that --all and --no-overwrite-ignore are incompatible,
> yes? Shouldn't they be reported as such rather than having one silently
> override the other?

I agree they are philosophically contradictory. I chose to downgrade INCLUDE_ALL_FILES to include-untracked when --no-overwrite-ignore is given so that users explicitly requesting preservation of ignored files are not surprised by their removal.

I am open to changing this to an explicit error instead if that is preferred. I went with downgrading to preserve backwards compatibility and to honor the more conservative option.

> Also, the commit message claims you are removing a FIXME comment, but
> no such removal is found in this patch.

Yes, that was an error in v2. In v3 the commit message no longer claims to remove the FIXME and is scoped only to fixing stash -a behavior plus adding regression tests.

Regarding tests, v3 now explicitly covers both:
- stash push -a --no-overwrite-ignore preserving ignored files
- stash push -a --overwrite-ignore removing them
using test_grep and test_path_is_missing as suggested.

Thanks also for the references to the broader unpack_trees and stash history. I understand this patch only addresses a small part of a much larger and messier area.

Please let me know if you would prefer the -a plus --no-overwrite-ignore combination to error out instead of downgrading.

Thanks, Pushkar

Previous: Elijah NewrenNext: Elijah Newren
Message 11 of 15 in “stash: honor --no-overwrite-ignore when updating index”
  1. stash: honor --no-overwrite-ignore when updating indexPushkar Singh, Feb 2, 2026
  2. Karthik NayakFeb 2, 2026
  3. D. Ben KnobleFeb 2, 2026
  4. Patrick SteinhardtFeb 2, 2026
  5. Kristoffer HaugsbakkFeb 2, 2026
  6. stash: honor --no-overwrite-ignore with --allPushkar Singh, Feb 2, 2026
  7. Kristoffer HaugsbakkFeb 2, 2026
  8. Pushkar SinghFeb 2, 2026
  9. D. Ben KnobleFeb 2, 2026
  10. Elijah NewrenFeb 2, 2026
  11. Pushkar SinghFeb 3, 2026
  12. Elijah NewrenFeb 3, 2026
  13. stash: honor --no-overwrite-ignore with --allPushkar Singh, Feb 3, 2026
  14. Elijah NewrenFeb 3, 2026
  15. Pushkar SinghFeb 3, 2026

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.