From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Đoàn Trần Công Danh'" <congdanhqx@gmail.com>,
"'Erik Janssen'" <eaw.janssen@chello.nl>
Cc: <git@vger.kernel.org>
Subject: RE: [Feature request] Add -u option to git rm to delete untracked files
Date: Wed, 27 May 2020 10:29:29 -0400 [thread overview]
Message-ID: <021801d63433$3f0c5e80$bd251b80$@nexbridge.com> (raw)
In-Reply-To: <20200527124445.GB2013@danh.dev>
On May 27, 2020 8:45 AM, Ðoàn Tr?n Công Danh wrote:
> To: Erik Janssen <eaw.janssen@chello.nl>
> Cc: git@vger.kernel.org
> Subject: Re: [Feature request] Add -u option to git rm to delete untracked
> files
>
> On 2020-05-26 23:21:23+0200, Erik Janssen <eaw.janssen@chello.nl> wrote:
> > Would it be feasible to add a -u option to git rm to specify that I
> > also want a file deleted if it is not tracked by git?
> > Currently, git rm -f can remove files in whatever state it seems,
> > except when it is untracked.
> > By allowing a -u option (-u: also delete untracked files) I would be
> > sure that the file is gone while it would also make sure that it
> > doesn't break past behaviour where people perhaps rely on git rm to
> > leave untracked files alone.
>
> I _think_ remove untracked file is pretty much risky operation, and it should
> be done separately/independently (via git-clean(1)).
A git alias could easily be set up to do this, of course dangerous because of what git-clean does without any arguments:
git config --global alias.rmu 'clean -f --'
> Let's assume we have -u|--untracked,
> nothing (probably) can stop our users from:
>
> git rm -u src
> git rm -u .
>
> Even git-clean(1) requires either --force or --interactive because it's too
> much risky to begin with.
>
> If we think Git as a FileSystem, its rm should only care about its tracked file. I
> prefer to just rm(1) instead of "git-rm -u".
next prev parent reply other threads:[~2020-05-27 14:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-26 21:21 [Feature request] Add -u option to git rm to delete untracked files Erik Janssen
2020-05-27 7:34 ` Jeff King
2020-05-27 12:44 ` Đoàn Trần Công Danh
2020-05-27 14:29 ` Randall S. Becker [this message]
2020-05-27 19:31 ` Erik Janssen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='021801d63433$3f0c5e80$bd251b80$@nexbridge.com' \
--to=rsbecker@nexbridge.com \
--cc=congdanhqx@gmail.com \
--cc=eaw.janssen@chello.nl \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.