threads / patch / 20477

patch, 9 partsupdate 'git-rm' bash completion according to the man page

Subject: [PATCH 6/9] update 'git-rm' bash completion according to the man page

## tl;dr

3 messages between Aug 8, 2009 and Aug 8, 2009. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Emmanuel Trillaud· Aug 8, 2009, 08:56 UTC · lore
Signed-off-by: Emmanuel Trillaud <etrillaud@gmail.com>
---
 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 98e1185..4746eee 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1828,7 +1828,7 @@ _git_rm ()
 	local cur="${COMP_WORDS[COMP_CWORD]}"
 	case "$cur" in
 	--*)
-		__gitcomp "--cached --dry-run --ignore-unmatch --quiet"
+		__gitcomp "--force --cached --dry-run --ignore-unmatch --quiet"
 		return
 		;;
 	esac
-- 
1.6.4
Junio C Hamano· Aug 8, 2009, 19:49 UTC · re: Emmanuel Trillaud · lore

Re: [PATCH 6/9] update 'git-rm' bash completion according to the man page

Emmanuel Trillaud <etrillaud@gmail.com> writes:
> Signed-off-by: Emmanuel Trillaud <etrillaud@gmail.com>
Description of what you did?
> -		__gitcomp "--cached --dry-run --ignore-unmatch --quiet"
> +		__gitcomp "--force --cached --dry-run --ignore-unmatch --quiet"

I thought not completing --force to allow a dangerous operation was a conscious decision.

Emmanuel Trillaud· Aug 8, 2009, 20:33 UTC · re: Junio C Hamano · lore

Re: [PATCH 6/9] update 'git-rm' bash completion according to the man page

Show 7 quoted lines
> > -		__gitcomp "--cached --dry-run --ignore-unmatch
> > --quiet"
> > +		__gitcomp "--force --cached --dry-run
> > --ignore-unmatch --quiet"
> 
> I thought not completing --force to allow a dangerous operation was a
> conscious decision.

For me, completion as always been a reminder for options I forgot (or I think they exist) and I use short options when I know them because it is easier to type. So IMHO '--force' is a useful option that deserve to be complete.

But if you make a conscious decision in the past to not complete '--force', I won't fight :-) and I will just add a comment in the git-completion script for the guys like me who think it is missing.

Best regard 
Emmanuel

← back to recent threads