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

Re: [BUG] git stash refuses to save after "add -N"

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 30, 2009, 20:01 UTC
Message-ID
<7v63c5f4vs.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090830095509.GB30922@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> On Sat, Aug 29, 2009 at 03:34:45PM -0700, Junio C Hamano wrote:
>
>> I am slightly in favor of leaving the things as they are, as the error
>> message is quite clear.
>
> Hmm. Thinking about it a bit more, I think "add as empty content" is
> probably the best. It scares me a little because it is losing
> information during the stash, but consider it from the user's
> perspective.
> ...
> And all of this while they are trying to quickly switch contexts to
> whatever it was that caused them to stash in the first place.

Ok, then probably the "how about" patch would be a part of the right solution.

One thing I noticed was that while unstashing without --index, we add full contents to the index of new files. I think it is because back then when stash was written there was no other way, but now we have intent-to-add and a way to stash such an entry, I think we should add only the intent to add them in that codepath.

Of course we will not do this when unstashing with --index.
Previous: Jeff KingNext: Jeff King
Message 6 of 11 in “[BUG] git stash refuses to save after "add -N"”
  1. Yann DirsonAug 28, 2009
  2. Jeff KingAug 28, 2009
  3. Jeff KingAug 28, 2009
  4. Junio C HamanoAug 29, 2009
  5. Jeff KingAug 30, 2009
  6. Junio C HamanoAug 30, 2009
  7. Jeff KingAug 31, 2009
  8. Junio C HamanoAug 31, 2009
  9. Jeff KingAug 31, 2009
  10. Yann DirsonAug 31, 2009
  11. Jeff KingAug 31, 2009

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.