Web lists-archives.com

Re: Is git-checkout's restoring d/f conflict really sane?




Duy Nguyen <pclouds@xxxxxxxxx> writes:

> Technically 'one' is still tracked (even if it's a directory) so what
> we're doing is right. I'm just not sure if there's some big surprise
> factor here. And whether it's better to pause and double check with
> the user before deleting everything.

I agree to all of the above, including the part "technically it is
correct", but more importantly "stop and double check".  

As changing between a directory and a non-directory is a rare event
anyway, I do not mind making it a bit more cumbersome and say "you
asked me to check out a regular file 'one', but you have a directory
'one', that has an unignored untracked file in it, so I'd refuse to
do so.  Come back after you removed them manually, or use the '--force'
option".

We should not refuse if 'one' is an empty directory or all files in
it are ignored, though.

Thanks.