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

Re: [PATCH] completion: add completer for status

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 28, 2013, 13:20 UTC
Message-ID
<CALkWK0=pyzcx-rB9gjRecoD1MFkHrSdYwLurD8y805O3FwT4Cg@mail.gmail.com>
In-Reply-To
<20130628112631.GC16562@goldbirke>
SZEDER Gábor wrote:
Show 10 quoted lines
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 912fb988..b68024c6 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1697,6 +1697,8 @@ _git_stage ()
>
>  _git_status ()
>  {
> +       __git_has_doubledash && return
> +

This line makes absolutely no sense to me. When the case statement fails to match anything (which it will, when a double-dash is present), we'll use the __git_complete_index_file which is superior to returning and falling back to the dumb zsh file listing, no? As a result, without that line,

  $ git status -- foo<TAB>

will complete fine when foo* isn't necessarily a file in the filesystem, but something that our ls-files returns, no?

Show 9 quoted lines
>         case "$cur" in
>         --untracked-files=*)
>                 __gitcomp "no normal all" "" "${cur##--untracked-files=}"
> @@ -1718,7 +1720,7 @@ _git_status ()
>                 return
>                 ;;
>         esac
> -       __git_complete_index_file
> +       __git_complete_index_file "--with-tree=HEAD --cached --deleted"

Might as well go all the way with "--cached --deleted --unmerged --others" no? What is the point of --with-tree=HEAD?

Thanks.
Previous: SZEDER GáborNext: Ramkumar Ramachandra
Message 6 of 9 in “completion: add completer for status”
  1. completion: add completer for statusRamkumar Ramachandra, Jun 24, 2013
  2. Ramkumar RamachandraJun 24, 2013
  3. SZEDER GáborJun 28, 2013
  4. SZEDER GáborJun 28, 2013
  5. SZEDER GáborJun 28, 2013
  6. Ramkumar RamachandraJun 28, 2013
  7. Ramkumar RamachandraJun 28, 2013
  8. SZEDER GáborJun 30, 2013
  9. SZEDER GáborJun 28, 2013

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.