From: Junio C Hamano Date: Thu, 02 Jun 2016 18:14:33 GMT Subject: Re: [PATCH v3 2/2] completion: add git status Message-ID: In-Reply-To: <1464880296.3720.0.camel@virtuell-zuhause.de> Thomas Braun writes: > + untracked_state="$(__git_find_on_cmdline "--untracked-files=no\ > + --untracked-files=normal --untracked-files=all")" Just wondering but does this help my use of the command like $ git status -uno or do I now have to spell it out like $ git status --untracked-files=no to take advantage of it? > + untracked_state=${untracked_state##--untracked-files=} > + > + if [ -z "$untracked_state" ]; then > + untracked_state="$(git --git-dir="$(__gitdir)" config "status.showUntrackedFiles")" > + fi > + > + case "$untracked_state" in > + no) > + # --ignored option does not matter Style. I see existing case/esac statements that use this style, but our preference is not to indent case arms like this; rather: case "$untracked_state" in no) # --ignored ... which saves the indentation one level overall. > + complete_opt= > + ;; > + all|normal|*) > + complete_opt="--cached --directory --no-empty-directory --others" > + > + if [ -n "$(__git_find_on_cmdline "--ignored")" ]; then Same question as the "--untracked-files=no vs -uno" applies here. > + 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