git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* git add --intent-to-add + git stash "Cannot save the current worktree state"
@ 2019-01-03 20:46 Anthony Sottile
  2019-01-09 18:24 ` Johannes Schindelin
  2019-01-10 17:45 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Anthony Sottile @ 2019-01-03 20:46 UTC (permalink / raw)
  To: Git Mailing List

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
```

Anthony

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git add --intent-to-add + git stash "Cannot save the current worktree state"
  2019-01-03 20:46 git add --intent-to-add + git stash "Cannot save the current worktree state" Anthony Sottile
@ 2019-01-09 18:24 ` Johannes Schindelin
  2019-01-09 18:36   ` Anthony Sottile
  2019-01-10 17:45 ` Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Johannes Schindelin @ 2019-01-09 18:24 UTC (permalink / raw)
  To: Anthony Sottile; +Cc: Git Mailing List

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git add --intent-to-add + git stash "Cannot save the current worktree state"
  2019-01-09 18:24 ` Johannes Schindelin
@ 2019-01-09 18:36   ` Anthony Sottile
  2019-01-10 15:21     ` Johannes Schindelin
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Sottile @ 2019-01-09 18:36 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Git Mailing List

On Wed, Jan 9, 2019 at 10:25 AM Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git add --intent-to-add + git stash "Cannot save the current worktree state"
  2019-01-09 18:36   ` Anthony Sottile
@ 2019-01-10 15:21     ` Johannes Schindelin
  2019-01-10 16:16       ` Anthony Sottile
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Schindelin @ 2019-01-10 15:21 UTC (permalink / raw)
  To: Anthony Sottile; +Cc: Git Mailing List

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git add --intent-to-add + git stash "Cannot save the current worktree state"
  2019-01-10 15:21     ` Johannes Schindelin
@ 2019-01-10 16:16       ` Anthony Sottile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony Sottile @ 2019-01-10 16:16 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Git Mailing List

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git add --intent-to-add + git stash "Cannot save the current worktree state"
  2019-01-03 20:46 git add --intent-to-add + git stash "Cannot save the current worktree state" Anthony Sottile
  2019-01-09 18:24 ` Johannes Schindelin
@ 2019-01-10 17:45 ` Junio C Hamano
  1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2019-01-10 17:45 UTC (permalink / raw)
  To: Anthony Sottile; +Cc: Git Mailing List

Anthony Sottile <asottile@umich.edu> writes:

> 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
> ```

This is one of the well-known fundamental limitations of the design
of "git stash".

States in the index like "it is known that this path would be added
with some contents, but not quite added yet as the final contents
have not been decided (aka intent-to-add)" and "there are
conflicting wishes for the contents for this path and the final
decision has not bee made (aka unmerged)" cannot be left undecided
before getting written to a tree object (hence a commit object that
is used to represent a stash entry).

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03 20:46 git add --intent-to-add + git stash "Cannot save the current worktree state" Anthony Sottile
2019-01-09 18:24 ` Johannes Schindelin
2019-01-09 18:36   ` Anthony Sottile
2019-01-10 15:21     ` Johannes Schindelin
2019-01-10 16:16       ` Anthony Sottile
2019-01-10 17:45 ` Junio C Hamano

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox