# [PATCH] builtin-rm: Add a --force flag

6 messages from 2008-08-08 to 2008-08-09. Participants: Pieter de Bie, Junio C Hamano, Todd Zullinger, Jeff King, SZEDER Gábor.
Thread: https://gitlist.dev/t/14899

## Pieter de Bie, 2008-08-08 22:37

Subject: [PATCH] builtin-rm: Add a --force flag
Message-ID: <1218235022-33695-1-git-send-email-pdebie@ai.rug.nl>
URL: https://gitlist.dev/e/1218235022-33695-1-git-send-email-pdebie%40ai.rug.nl

```
This adds a --force flag to git-rm, making it somewhat easier for
subversion people to switch.

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
---

  I heard some people complain about how they try "svn rm -f" or "git rm
  --force", which both fail. We can help them a bit by supporting --force too.

 builtin-rm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-rm.c b/builtin-rm.c
index ee8247b..4c9f483 100644
--- a/builtin-rm.c
+++ b/builtin-rm.c
@@ -131,7 +131,7 @@ static struct option builtin_rm_options[] = {
 	OPT__DRY_RUN(&show_only),
 	OPT__QUIET(&quiet),
 	OPT_BOOLEAN( 0 , "cached",         &index_only, "only remove from the index"),
-	OPT_BOOLEAN('f', NULL,             &force,      "override the up-to-date check"),
+	OPT_BOOLEAN('f', "force",             &force,      "override the up-to-date check"),
 	OPT_BOOLEAN('r', NULL,             &recursive,  "allow recursive removal"),
 	OPT_BOOLEAN( 0 , "ignore-unmatch", &ignore_unmatch,
 				"exit with a zero status even if nothing matched"),
-- 
1.6.0.rc1.288.g5b89f

```

## Junio C Hamano, 2008-08-08 23:05

Subject: Re: [PATCH] builtin-rm: Add a --force flag
Message-ID: <7v8wv7az0z.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v8wv7az0z.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1218235022-33695-1-git-send-email-pdebie@ai.rug.nl>

```
I think this makes sense even this late in -rc cycle.  Thanks.

```

## Todd Zullinger, 2008-08-08 23:41

Subject: [PATCH] bash completion: git rm has grown a --force option
Message-ID: <20080808234134.GH5655@inocybe.teonanacatl.org>
URL: https://gitlist.dev/e/20080808234134.GH5655%40inocybe.teonanacatl.org
In-Reply-To: <7v8wv7az0z.fsf@gitster.siamese.dyndns.org>

```
Signed-off-by: Todd Zullinger <tmz@pobox.com>
---

Junio C Hamano wrote:
> I think this makes sense even this late in -rc cycle.  Thanks.

Perhaps this is worth adding as well then, since Lee went to the
trouble of adding completion for git rm just the other day? ;)

 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 3396e35..2d0e468 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1361,7 +1361,7 @@ _git_rm ()
 	local cur="${COMP_WORDS[COMP_CWORD]}"
 	case "$cur" in
 	--*)
-		__gitcomp "--cached --dry-run --ignore-unmatch --quiet"
+		__gitcomp "--cached --dry-run --force --ignore-unmatch --quiet"
 		return
 		;;
 	esac
-- 
1.6.0.rc2

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In some cultures what I do would be considered normal.

```

## Jeff King, 2008-08-09 00:05

Subject: Re: [PATCH] builtin-rm: Add a --force flag
Message-ID: <20080809000536.GB6065@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20080809000536.GB6065%40sigill.intra.peff.net
In-Reply-To: <7v8wv7az0z.fsf@gitster.siamese.dyndns.org>

```
On Fri, Aug 08, 2008 at 04:05:16PM -0700, Junio C Hamano wrote:

> I think this makes sense even this late in -rc cycle.  Thanks.

Maybe squash this in?

-Peff

diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
index 4d0c495..0aaf161 100644
--- a/Documentation/git-rm.txt
+++ b/Documentation/git-rm.txt
@@ -36,6 +36,7 @@ OPTIONS
 	but this requires the `-r` option to be explicitly given.
 
 -f::
+--force::
 	Override the up-to-date check.
 
 -n::

```

## SZEDER Gábor, 2008-08-09 01:07

Subject: Re: [PATCH] bash completion: git rm has grown a --force option
Message-ID: <20080809010713.GF7299@neumann>
URL: https://gitlist.dev/e/20080809010713.GF7299%40neumann
In-Reply-To: <20080808234134.GH5655@inocybe.teonanacatl.org>

```
Hi,

On Fri, Aug 08, 2008 at 07:41:34PM -0400, Todd Zullinger wrote:
> Perhaps this is worth adding as well then, since Lee went to the
> trouble of adding completion for git rm just the other day? ;)
I disagree here.  '--force' is an option that should be used with
care, therefore facilitating its usage by completion support is not a
good idea IMHO.  This is also the status quo:  while there are many
git commands with a '--force' option, we do not complete any of them.

Regards,
Gábor

```

## Todd Zullinger, 2008-08-09 01:21

Subject: Re: [PATCH] bash completion: git rm has grown a --force option
Message-ID: <20080809012158.GI5655@inocybe.teonanacatl.org>
URL: https://gitlist.dev/e/20080809012158.GI5655%40inocybe.teonanacatl.org
In-Reply-To: <20080809010713.GF7299@neumann>

```
SZEDER Gábor wrote:
> I disagree here.  '--force' is an option that should be used with
> care, therefore facilitating its usage by completion support is not
> a good idea IMHO.  This is also the status quo:  while there are
> many git commands with a '--force' option, we do not complete any of
> them.

Yes, my apologies for missing that point.  It is a good one.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A word to the wise ain't necessary -- it's the stupid ones who need
the advice.
    -- Bill Cosby


```
