Re: [PATCH] git stash: Avoid data loss when saving a stash

2013-07-06 Thread Petr Baudis
Hi! (tl;dr - I disagree but this issue is perhaps not so important in practice) On Sun, Jun 30, 2013 at 12:14:26PM -0700, Junio C Hamano wrote: > I do not agree with your `git reset --hard` at all. With the > command, the user demands "no matter what, I want get rid of any > funny state in m

Re: [PATCH] git stash: Avoid data loss when saving a stash

2013-06-30 Thread Junio C Hamano
Petr Baudis writes: > Hi! > > On Fri, Jun 28, 2013 at 11:39:16AM -0700, Junio C Hamano wrote: >> Thanks. I'll queue it with a pair of fix-up commits on top, so that >> they can later be squashed in. >> >> The result of squashing the fix-ups would look like this. > > Thanks! I agree with all

Re: [PATCH] git stash: Avoid data loss when saving a stash

2013-06-30 Thread Petr Baudis
Hi! On Fri, Jun 28, 2013 at 11:39:16AM -0700, Junio C Hamano wrote: > Thanks. I'll queue it with a pair of fix-up commits on top, so that > they can later be squashed in. > > The result of squashing the fix-ups would look like this. Thanks! I agree with all of your changes. > -- >8 -- > Fr

Re: [PATCH] git stash: Avoid data loss when saving a stash

2013-06-28 Thread Junio C Hamano
Junio C Hamano writes: > Petr Baudis writes: > >> diff --git a/git-stash.sh b/git-stash.sh >> index 1e541a2..3cb9b05 100755 >> --- a/git-stash.sh >> +++ b/git-stash.sh >> @@ -258,6 +262,12 @@ save_stash () { >> say "$(gettext "No local changes to save")" >> exit 0 >>

Re: [PATCH] git stash: Avoid data loss when saving a stash

2013-06-28 Thread Junio C Hamano
Petr Baudis writes: > diff --git a/git-stash.sh b/git-stash.sh > index 1e541a2..3cb9b05 100755 > --- a/git-stash.sh > +++ b/git-stash.sh > @@ -258,6 +262,12 @@ save_stash () { > say "$(gettext "No local changes to save")" > exit 0 > fi > + if test -z "$untrac

Re: [PATCH] git stash: Avoid data loss when saving a stash

2013-06-28 Thread Junio C Hamano
Petr Baudis writes: > Signed-off-by: Petr Baudis > --- > > Please Cc me, I'm currently not subscribed on the list. Heh, long time no see. > @@ -71,6 +72,13 @@ linkgit:git-add[1] to learn how to operate the `--patch` > mode. > + > The `--patch` option implies `--keep-index`. You can use >

[PATCH] git stash: Avoid data loss when saving a stash

2013-06-28 Thread Petr Baudis
I have been recently again bitten by git stash versus an uncommitted file-to-directory change that happily threw away few gigabytes of my data. This has been recently discussed in the past, e.g. http://thread.gmane.org/gmane.comp.version-control.git/202332/ and I implemented Junio's sugge