threads / patch / 14899

patchbuiltin-rm: Add a --force flag

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

## tl;dr

6 messages between Aug 8, 2008 and Aug 9, 2008. Diffs are folded; open one to read it.

replies: 5people: 5as markdown or json

Pieter de Bie· Aug 8, 2008, 22:37 UTC · lore

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(-)
Show changes to builtin-rm.c +1 −1
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
Todd Zullinger· Aug 8, 2008, 23:41 UTC · re: Junio C Hamano · lore

[PATCH] bash completion: git rm has grown a --force option

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(-)
Show changes to contrib/completion/git-completion.bash +1 −1
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.
SZEDER Gábor· Aug 9, 2008, 01:07 UTC · re: Todd Zullinger · lore

Re: [PATCH] bash completion: git rm has grown a --force option

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· Aug 9, 2008, 01:21 UTC · re: SZEDER Gábor · lore

Re: [PATCH] bash completion: git rm has grown a --force option

SZEDER Gábor wrote:
Show 5 quoted lines
> 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
Jeff King· Aug 9, 2008, 00:05 UTC · re: Junio C Hamano · lore

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

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
Show changes to Documentation/git-rm.txt +1 −0
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::

← back to recent threads