Commits

Anonymous committed 27fdf81 Merge

Merge branch 'rc/maint-complete-git-p4' into pu

Comment from Pete will need to be addressed ($gmane/206172).

* rc/maint-complete-git-p4:
Teach git-completion about git p4

Comments (0)

Files changed (1)

contrib/completion/git-completion.bash

 	esac
 }
 
+_git_p4 ()
+{
+	local subcommands="
+		clone sync rebase submit
+		"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
+	if [ -z "$subcommand" ]; then
+		__gitcomp "$subcommands"
+	else
+		local common_opts="--git-dir= --verbose"
+		local sync_opts="
+			--branch= --detect-branches --changes-file=
+			--silent --detect-labels --import-labels
+			--import-local --max-changes= --keep-path
+			--use-client-spec $common_opts
+			"
+		local clone_opts="
+			--destination= --bare $sync_opts
+			"
+		local submit_opts="
+			--origin= -M --preserve-user --export-labels
+			$common_opts
+			"
+
+		case "$subcommand,$cur" in
+		clone,--*)
+			__gitcomp "$clone_opts"
+			;;
+		sync,--*)
+			__gitcomp "$sync_opts"
+			;;
+		rebase,--*)
+			__gitcomp "$common_opts --import-labels"
+			;;
+		submit,--*)
+			__gitcomp "$submit_opts"
+			;;
+		submit,*)
+			__gitcomp "$(__git_refs)"
+			;;
+		esac
+	fi
+}
+
 _git_pull ()
 {
 	__git_complete_strategy && return
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.