Re: Can't git stash after using git add -N

2016-03-19 Thread Josh Triplett
On Tue, Mar 15, 2016 at 09:51:35PM -0700, Junio C Hamano wrote: > Josh Triplett writes: > > > As far as I can tell, if I run "git add -N" on a file, and then commit > > without adding the file contents, it gets committed as an empty file. > > Is that true? Git once

Re: Can't git stash after using git add -N

2016-03-19 Thread Jeff King
On Wed, Mar 16, 2016 at 02:11:19PM -0700, Junio C Hamano wrote: > I actually think "silently ignore intent-to-add" was a mistake. > We used to error out at write-tree time, which I think is the > right behaviour--"I know I want to have this path, but I cannot > yet decide with what content" is

Re: Can't git stash after using git add -N

2016-03-19 Thread Jeff King
On Wed, Mar 16, 2016 at 05:02:45AM -0700, Josh Triplett wrote: > On Tue, Mar 15, 2016 at 09:51:35PM -0700, Junio C Hamano wrote: > > Josh Triplett writes: > > > > > As far as I can tell, if I run "git add -N" on a file, and then commit > > > without adding the file

Re: Can't git stash after using git add -N

2016-03-18 Thread Junio C Hamano
I actually think "silently ignore intent-to-add" was a mistake. We used to error out at write-tree time, which I think is the right behaviour--"I know I want to have this path, but I cannot yet decide with what content" is what the user is telling us when she says "add -N", so until that

Re: Can't git stash after using git add -N

2016-03-16 Thread Duy Nguyen
On Wed, Mar 16, 2016 at 11:51 AM, Junio C Hamano wrote: > Josh Triplett writes: > >> As far as I can tell, if I run "git add -N" on a file, and then commit >> without adding the file contents, it gets committed as an empty file. > > Is that true? Git

Re: Can't git stash after using git add -N

2016-03-15 Thread Junio C Hamano
Josh Triplett writes: > As far as I can tell, if I run "git add -N" on a file, and then commit > without adding the file contents, it gets committed as an empty file. Is that true? Git once worked like that in earlier days, but I think write-tree (hence commit) would

Re: Can't git stash after using git add -N

2016-03-15 Thread Josh Triplett
On Tue, Mar 15, 2016 at 04:46:48PM -0700, Junio C Hamano wrote: > Josh Triplett writes: > > After using "git add -N", "git stash" can no longer stash: > > I think this is unfortunately one of the fundamental limitations > that comes from the way how "stash" is implemented.

Re: Can't git stash after using git add -N

2016-03-15 Thread Junio C Hamano
Josh Triplett writes: > After using "git add -N", "git stash" can no longer stash: I think this is unfortunately one of the fundamental limitations that comes from the way how "stash" is implemented. It uses three tree objects (i.e. HEAD's tree that represents where you