git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / 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, other threads:[~2019-01-10 17:45 UTC | newest]

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

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).