Re: [PATCH,RFC] Implement 'git rm --if-missing'
- From
Avery Pennarun <apenwarr@gmail.com>
- Date
- Jul 16, 2008, 18:17 UTC
- Message-ID
- <32541b130807161117h54e97825o9119655f73138341@mail.gmail.com>
- In-Reply-To
- <20080716180617.GO32184@machine.or.cz>
On 7/16/08, Petr Baudis <pasky@suse.cz> wrote:
Show 9 quoted lines
> On Wed, Jul 16, 2008 at 07:00:50PM +0100, Ciaran McCreesh wrote: > > git rm --if-missing will only remove files if they've already been removed from > > disk. > > > > Signed-off-by: Ciaran McCreesh <ciaran.mccreesh@googlemail.com> > > what is the usage scenario? The porcelain options space is a precious > resource, so please explain why do you need this and who is going to use > it (especially with such a long name).
I see the idea here: right now you can do:
touch a b c
git add .And have it auto-add all the new files, so "git commit" will work. But there is no equivalent for rm, because for obvious reasons,
rm b c
git rm .Doesn't do the same thing. And "git add ." doesn't auto-recognize deletions, which probably also makes sense.
"git commit -a", on the other hand, will automatically commit all deletions for you. But you don't always want to commit *all* your changes just because you want to commit all your deletions.
That said, --if-missing is a bit unwieldy. I don't have a better suggestion though.
Have fun,
Avery