Re: [PATCH] git clean: Don't automatically remove directories when run within subdirectory

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joachim Berdal Haga
Date: Monday, April 14, 2008 - 11:33 pm

Shawn Bohrer wrote:

No, check this out; note that only in the very last case dir/subdir/subfile
would be removed.

$ git init; mkdir -p dir/subdir; touch dir/file dir/subdir/subfile
Initialized empty Git repository in .git/
$ touch dir/tracked-file; git add dir/tracked-file
$ ~/src/git/git-clean -n dir/
Would remove dir/file
Would not remove dir/subdir/
$ ~/src/git/git-clean -n dir
Would remove dir/file
Would not remove dir/subdir/
$ git rm -f dir/tracked-file
rm 'dir/tracked-file'
$ ~/src/git/git-clean -n dir/
Would remove dir/file
Would not remove dir/subdir/
$ ~/src/git/git-clean -n dir
Would remove dir/


Yes, although it could be made less strange by adding a short explanation,
like "Would not remove dir/ (-d not given)". But I also think that the
difference between "dir" and "dir/" is very (too?) subtle in this case and
therefore should require explicit approval/action from the user.


-j.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] git clean: Don't automatically remove director ..., Joachim Berdal Haga, (Mon Apr 14, 12:03 am)
Re: [PATCH] git clean: Don't automatically remove director ..., Joachim Berdal Haga, (Mon Apr 14, 11:18 am)
Re: [PATCH] git clean: Don't automatically remove director ..., Joachim Berdal Haga, (Mon Apr 14, 11:33 pm)
Re: [PATCH] git clean: Don't automatically remove director ..., Joachim Berdal Haga, (Tue Apr 15, 7:46 am)