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 10, 2019, 16:16 UTC
Message-ID
<CA+dzEBnUTybrK-V3xQJmDoNU8wDtuDKhDzKEtCBhFdP=5x3G5Q@mail.gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1901101620470.41@tvgsbejvaqbjf.bet>

On Thu, Jan 10, 2019 at 7:21 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 54 quoted lines
>
> Hi Anthony,
>
> On Wed, 9 Jan 2019, Anthony Sottile wrote:
>
> > On Wed, Jan 9, 2019 at 10:25 AM Johannes Schindelin
> > <Johannes.Schindelin@gmx.de> wrote:
> > >
> > > 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?
> > >
> > > 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`
>
> Whoops. I thought that you were on a different Git version, one that
> already has the built-in stash. My mistake.
>
> Sorry,
> Johannes

Oh, is there a more recent version than the one mirrored at https://github.com/git/git

Anthony
Previous: Johannes SchindelinNext: Junio C Hamano
Message 5 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.