Re: [PATCH v4 3/3] completion: add git status

2 messages, 2 authors, 2016-06-16 · open the first message on its own page

Re: [PATCH v4 3/3] completion: add git status

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:45

Thomas Braun [off-list ref] writes:
+	case "$cur" in
+	--ignore-submodules=*)
+		__gitcomp "none untracked dirty all" "" "${cur##--ignore-submodules=}"
+		return
+		;;
+	--untracked-files=*)
+		__gitcomp "$__git_untracked_file_modes" "" "${cur##--untracked-files=}"
+		return
+		;;
+	--column=*)
+		__gitcomp "
+			always never auto column row plain dense nodense
+			" "" "${cur##--column=}"
+		return
+		;;
+	--*)
+		__gitcomp "
+			--short --branch --porcelain --long --verbose
+			--untracked-files= --ignore-submodules= --ignored
+			--column= --no-column
+			"
+		return
+		;;
+	esac
+
+	untracked_state="$(__git_get_option_value "-u" "--untracked-files="\
If you have a SP before that backslash, you can avoid getting
misunderstood that you are attempting to extend that string
"--untracked-files=".  The backslash is telling the shell that there
are more arguments to come, and it is misleading to rely on the fast
that the next line happens to begin with a whitespace.
+		"$__git_untracked_file_modes" "status.showUntrackedFiles")"
+	case "$untracked_state" in
+	no)
+		# --ignored option does not matter
+		complete_opt=
+		;;
+	all|normal|*)
+		complete_opt="--cached --directory --no-empty-directory --others"
+
+		if [ -n "$(__git_find_on_cmdline "--ignored")" ]; then
+			complete_opt="$complete_opt --ignored --exclude=*"
+		fi
+		;;
+	esac
+
+	__git_complete_index_file "$complete_opt"
+}
+
 __git_config_get_set_variables ()
 {
 	local prevword word config_file= c=$cword

Re: [PATCH v4 3/3] completion: add git status

From: Thomas Braun <hidden>
Date: 2016-06-16 02:19:46

Am 06.06.2016 um 19:57 schrieb Junio C Hamano:
Thomas Braun [off-list ref] writes:
quoted
+	case "$cur" in
+	--ignore-submodules=*)
+		__gitcomp "none untracked dirty all" "" "${cur##--ignore-submodules=}"
+		return
+		;;
+	--untracked-files=*)
+		__gitcomp "$__git_untracked_file_modes" "" "${cur##--untracked-files=}"
+		return
+		;;
+	--column=*)
+		__gitcomp "
+			always never auto column row plain dense nodense
+			" "" "${cur##--column=}"
+		return
+		;;
+	--*)
+		__gitcomp "
+			--short --branch --porcelain --long --verbose
+			--untracked-files= --ignore-submodules= --ignored
+			--column= --no-column
+			"
+		return
+		;;
+	esac
+
+	untracked_state="$(__git_get_option_value "-u" "--untracked-files="\
If you have a SP before that backslash, you can avoid getting
misunderstood that you are attempting to extend that string
"--untracked-files=".  The backslash is telling the shell that there
are more arguments to come, and it is misleading to rely on the fast
that the next line happens to begin with a whitespace.
Thanks, will be fixed in the reroll.
quoted
+		"$__git_untracked_file_modes" "status.showUntrackedFiles")"
quoted
+	case "$untracked_state" in
+	no)
+		# --ignored option does not matter
+		complete_opt=
+		;;
+	all|normal|*)
+		complete_opt="--cached --directory --no-empty-directory --others"
+
+		if [ -n "$(__git_find_on_cmdline "--ignored")" ]; then
+			complete_opt="$complete_opt --ignored --exclude=*"
+		fi
+		;;
+	esac
+
+	__git_complete_index_file "$complete_opt"
+}
+
 __git_config_get_set_variables ()
 {
 	local prevword word config_file= c=$cword
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help