From: Mikhail Subject: Re: got: rm * removes current directory To: Omar Polo Cc: gameoftrees@openbsd.org Date: Sat, 27 May 2023 11:19:56 +0300 On Sat, May 27, 2023 at 10:15:53AM +0200, Omar Polo wrote: > On 2023/05/27 10:58:41 +0300, Mikhail wrote: > > core:~/work/got$ cd got > > core:~/work/got/got$ ls > > Makefile git-repository.5 got-worktree.5 got.1 > > got.c got.conf.5 > > core:~/work/got/got$ got rm * > > D got/Makefile > > D got/git-repository.5 > > D got/got-worktree.5 > > D got/got.1 > > D got/got.c > > D got/got.conf.5 > > core:~/work/got/got$ ls > > colorls: .: No such file or directory > > core:~/work/got/got$ cd .. > > core:~/work/got$ ls got > > colorls: got: No such file or directory > > > > git rm * removes only files, not current directory > > > > in case this is a bug here is a test case: > > Since git doesn't track directories, having 'got rm' removing empty > directories seems a useful feature to me, even though having $PWD > disappearing from under your feets is not nice. > > However, what would be the value in keeping empty directories on-disk > around? I faced this when I was working on port - I needed to "got rm *" inside patches/ and then I wanted to add my own patch files there.