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

Re: git add --intent-to-add + git stash "Cannot save the current worktree state"

From
Anthony Sottile <asottile@umich.edu>
Date
Jan 9, 2019, 18:36 UTC
Message-ID
<CA+dzEBn_-=77ZzfOaS8nVnQkf4rh0Y6TbEknZe6c02cwktrTJg@mail.gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1901091922300.41@tvgsbejvaqbjf.bet>

On Wed, Jan 9, 2019 at 10:25 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 41 quoted lines
>
> Hi Anthony,
>
> On Thu, 3 Jan 2019, Anthony Sottile wrote:
>
> > Minimal reproduction
> >
> > ```
> > git init t
> > git -C t commit --allow-empty -m 'initial commit'
> > touch t/a
> > git -C t add --intent-to-add a
> > git -C t stash
> > ```
> >
> > ```
> > + git init t
> > Initialized empty Git repository in /private/tmp/t/t/.git/
> > + git -C t commit --allow-empty -m 'initial commit'
> > [master (root-commit) 858132e] initial commit
> > + touch t/a
> > + git -C t add --intent-to-add a
> > + git -C t stash
> > error: Entry 'a' not uptodate. Cannot merge.
> > Cannot save the current worktree state
> > ```
>
> Apparently it is even worse. On Windows, this reportedly resulted in a
> segmentation fault:
>
> https://github.com/git-for-windows/git/issues/2006
>
> Could you cherry-pick the fix of
> https://github.com/git-for-windows/git/pull/2008 and see whether it fixes
> your use case, too?
>
> Ciao,
> Johannes
>
> P.S.: Obviously, if this PR fixes the issue, the corresponding change
> should be squashed into the appropriate commit in ps/stash-in-c.

I don't see a `stash.c` in ecbdaf0899161c067986e9d9d564586d4b045d62 -- the patch doesn't appear to apply

`stash` appears to be implemented as `git-stash.sh`
Anthony
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 6 in “git add --intent-to-add + git stash "Cannot save the current worktree state"”
  1. Anthony SottileJan 3, 2019
  2. Johannes SchindelinJan 9, 2019
  3. Anthony SottileJan 9, 2019
  4. Johannes SchindelinJan 10, 2019
  5. Anthony SottileJan 10, 2019
  6. Junio C HamanoJan 10, 2019

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.