git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/4] completion: complete `git push --force-with-lease=`

From
John Keeping <john@keeping.me.uk>
Date
Jul 19, 2014, 09:45 UTC
Message-ID
<ead0ead00ac48f0a8fc316c0e5fa0b8fd04477c3.1405763157.git.john@keeping.me.uk>
In-Reply-To
<e9576136c09dbf65c5e614f9272d2c2afa96f5b6.1405763157.git.john@keeping.me.uk>
Signed-off-by: John Keeping <john@keeping.me.uk>
---
 contrib/completion/git-completion.bash | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 9dcc222..ad0e75c 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1621,6 +1621,22 @@ _git_pull ()
 
 __git_push_recurse_submodules="check on-demand"
 
+__git_complete_force_with_lease ()
+{
+	local cur_=$1
+
+	case "$cur_" in
+	--*=)
+		;;
+	*:*)
+		__gitcomp_nl "$(__git_refs)" "" "${cur_#*:}"
+		;;
+	*)
+		__gitcomp_nl "$(__git_refs)" "" "$cur_"
+		;;
+	esac
+}
+
 _git_push ()
 {
 	case "$prev" in
@@ -1634,6 +1650,10 @@ _git_push ()
 		;;
 	esac
 	case "$cur" in
+	--force-with-lease=*)
+		__git_complete_force_with_lease "${cur##--force-with-lease=}"
+		return
+		;;
 	--repo=*)
 		__gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}"
 		return
@@ -1647,7 +1667,7 @@ _git_push ()
 			--all --mirror --tags --dry-run --force --verbose
 			--quiet --prune --delete --follow-tags
 			--receive-pack= --repo= --set-upstream
-			--recurse-submodules=
+			--force-with-lease --force-with-lease= --recurse-submodules=
 		"
 		return
 		;;
-- 
2.0.1.472.g6f92e5f.dirty
Previous: John KeepingNext: Junio C Hamano
Message 6 of 18 in “completion: add missing terminator in case statement”
  1. 1/4 completion: add missing terminator in case statementJohn Keeping, Jul 19, 2014
  2. 2/4 completion: complete "unstuck" `git push --recurse-submodules`John Keeping, Jul 19, 2014
  3. Johannes SixtJul 19, 2014
  4. John KeepingJul 19, 2014
  5. 3/4 completion: add some missing options to `git push`John Keeping, Jul 19, 2014
  6. 4/4 completion: complete `git push --force-with-lease=`John Keeping, Jul 19, 2014
  7. Junio C HamanoJul 21, 2014
  8. Junio C HamanoJul 21, 2014
  9. John KeepingJul 22, 2014
  10. Junio C HamanoJul 22, 2014
  11. 1/3 completion: complete "unstuck" `git push --recurse-submodules`John Keeping, Jul 22, 2014
  12. 2/3 completion: add some missing options to `git push`John Keeping, Jul 22, 2014
  13. 3/3 completion: complete `git push --force-with-lease=`John Keeping, Jul 22, 2014
  14. Junio C HamanoJul 22, 2014
  15. John KeepingJul 22, 2014
  16. Junio C HamanoJul 22, 2014
  17. John KeepingJul 23, 2014
  18. Junio C HamanoJul 23, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.