git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git clean removes directories when not asked to
@ 2008-04-08 18:22 Joachim B Haga
  2008-04-08 18:38 ` Joachim B Haga
  0 siblings, 1 reply; 14+ messages in thread
From: Joachim B Haga @ 2008-04-08 18:22 UTC (permalink / raw)
  To: git

This is with debian packaged 1.5.4.4.

When invoked from a subdirectory, git clean removes more than it
should. According to the documentation, it should not remove
directories unless "-d" is given. However:


pep ~/src/test 0$ git init
Initialized empty Git repository in .git/
pep ~/src/test|master 0$ mkdir dir
pep ~/src/test|master 0$ mkdir dir/subdir
pep ~/src/test|master 0$ git clean -f
Not removing dir/
pep ~/src/test|master 0$ cd dir
pep ~/src/test/dir|master 0$ git clean -f
Removing subdir/
pep ~/src/test/dir|master 0$ ls subdir
ls: cannot access subdir: No such file or directory


Luckily I just lost some compilation results in this case, but this is
unexpected and dangerous behaviour.


(Additionally, I find the "-f" slightly annoying but that's not an issue here.)


-j

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-04-15 15:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-08 18:22 git clean removes directories when not asked to Joachim B Haga
2008-04-08 18:38 ` Joachim B Haga
2008-04-09 17:04   ` [PATCH] " Joachim B Haga
2008-04-13 23:49     ` [PATCH] git clean: Don't automatically remove directories when run within subdirectory Shawn Bohrer
2008-04-13 23:49       ` [PATCH] git clean: Add test to verify directories aren't removed with a prefix Shawn Bohrer
2008-04-14  7:03       ` [PATCH] git clean: Don't automatically remove directories when run within subdirectory Joachim Berdal Haga
2008-04-14  7:18       ` Junio C Hamano
2008-04-14 17:06         ` Shawn Bohrer
2008-04-14 18:18           ` Joachim Berdal Haga
2008-04-15  3:44             ` Shawn Bohrer
2008-04-15  6:33               ` Joachim Berdal Haga
2008-04-15 14:26                 ` Shawn Bohrer
2008-04-15 14:46                   ` Joachim Berdal Haga
2008-04-15  3:14           ` Shawn Bohrer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).