Re: [BUG] "git stash -- path" reports wrong unstaged changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 18, 2017 at 06:36:58PM +0000, Thomas Gummerer wrote:

> > +			if test -z "$GIT_QUIET" && ! git diff-files --quiet
> > +			then
> > +				say "$(gettext "Unstaged changes after reset:")"
> > +				git diff-files --name-status
> > +			fi
> >  		else
> >  			git reset --hard ${GIT_QUIET:+-q}
> >  		fi
> 
> This would mean the user gets something like in your case above:
> 
>     Unstaged changes after reset:
>      M	two
> 
> As a user that doesn't know the internal implementation of push_stash,
> this would make me wonder why git stash would mention a file that is
> not provided as pathspec, but not the one that was provided in the
> pathspec argument.

That's a good point. I was going for consistency with the non-pathspec
case, but of course it wouldn't mention any files in the first place,
because it's just done a complete "git reset --hard".

> I think one option would be to to just keep quiet about the exact
> changes that git stash push makes, similar to what we do in the
> --include-untracked and in the -p case.  The other option would be to
> find the files that are affected and print them, but that would
> probably be a bit too noisy especially in cases such as
> git stash push -- docs/*.

Yeah, that's the right thing. I was just trying to be too clever above.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]