On Mon, Sep 17, 2018 at 12:26 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > FWIW, I didn't mean to say that we should give users a way to > recover. Your "commit -a" or "commit $path" protection just > prevents the situation from happening, and I think it is sufficient. > > The sole point I wanted to raise by bringing up the above was that > we should have the same degree of protection against "add $path" or > "add -u". > > Of course, "index log" is interesting and it may even turn out to be > useful (I was skeptical about "reference log" the same way, but it > turned out to be useful without burdening the system too heavily), > and it may even remove the need for the "do not accidentally lose > information by adding more to the index" protection. But until that > happens, if we are to have such a protection, we would wnat to give > the same degree of protection to "commit" and "add". I think having both is good. There are a lot of ways to accidentally throw away work, and it's pretty frustrating to have it happen. But the reflog is also somewhat complicated, and I've definitely seen a lot of developers who've never heard of it, and struggle with the concept. I personally think having the nice "it looks like you're about to throw away all your changes, are you sure" style of protection using something like --clobber-index is useful as a mode, even if we have an index log of sorts. Having it be default helps new people, even if it does get in the way of someone who knows what they're doing. Having it be configurable, to me, sort of defeats the point, since it means having to tell people to turn this on. I personally don't mind having to type an extended option to clobber when I know it's what I want, but I can see that being painful. However, if we had a reflog for the index, this becomes less of a problem since recovery is much easier. Thanks, Jake