From: Junio C Hamano Date: Wed, 09 Aug 2023 20:57:11 GMT Subject: Re: [PATCH v1 1/1] git stash needing mkdir deletes untracked file Message-ID: In-Reply-To: <6e40eb0b-2331-1e39-bee0-c9720c24d1c8@gmail.com> Phillip Wood writes: > Although this change is framed in terms of changes to "git stash push" > I think the underlying issue and this patch actually affects all users > of unpack_trees(). For example if "README" is untracked then > > git checkout README > > will currently fail if :README is a blob but will succeed and > remove the untracked file if :README is a tree. Very true, and with an .untracked file nobody asked Git to create, presumably? I am not sure if the updated behaviour is better than the current behaviour. If "silent and unconditional removal" bothers us, I wonder if it is a lot better approach to error out and have the user sort out the mess, which is what we usually do when it gets tempting to "move it away with an arbitrary rename" like this patch tries to do. I dunno. Thanks.