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

Re: [PATCH] completion: add missing completions for log, diff, show

From
Max Rothman <max.r.rothman@gmail.com>
Date
Aug 2, 2019, 00:54 UTC
Message-ID
<CAFA_24J8Ry5LhRX5O82eJDtrqjEodDFTEniZNw06fKEWvwvYMA@mail.gmail.com>
In-Reply-To
<0102016bb065bf5e-005b0752-2594-45d5-a01a-12d0c5e24b70-000000@eu-west-1.amazonses.com>
Ping :)
On Thu, Aug 1, 2019 at 8:50 PM Max Rothman <max.r.rothman@gmail.com> wrote:
Show 77 quoted lines
>
> The bash completion script knows some options to "git log" and
> "git show" only in the positive form, (e.g. "--abbrev-commit"), but not
> in their negative form (e.g. "--no-abbrev-commit"). Add them.
>
> Also, the bash completion script is missing some other options to
> "git diff", and "git show" (and thus, all other commands that take
> "git diff"'s options). Add them. Of note, since "--indent-heuristic" is
> no longer experimental, add that too.
>
> Signed-off-by: Max Rothman <max.r.rothman@gmail.com>
> ---
>  contrib/completion/git-completion.bash | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 9f71bcde967bc..b6d18710135ec 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1474,6 +1474,8 @@ __git_diff_common_options="--stat --numstat --shortstat --summary
>                         --dirstat-by-file= --cumulative
>                         --diff-algorithm=
>                         --submodule --submodule= --ignore-submodules
> +                       --indent-heuristic --no-indent-heuristic
> +                       --textconv --no-textconv
>  "
>
>  _git_diff ()
> @@ -1782,6 +1784,10 @@ _git_log ()
>                 __gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}"
>                 return
>                 ;;
> +       --no-walk=*)
> +               __gitcomp "sorted unsorted" "" "${cur##--no-walk=}"
> +               return
> +               ;;
>         --*)
>                 __gitcomp "
>                         $__git_log_common_options
> @@ -1789,16 +1795,19 @@ _git_log ()
>                         $__git_log_gitk_options
>                         --root --topo-order --date-order --reverse
>                         --follow --full-diff
> -                       --abbrev-commit --abbrev=
> +                       --abbrev-commit --no-abbrev-commit --abbrev=
>                         --relative-date --date=
>                         --pretty= --format= --oneline
>                         --show-signature
>                         --cherry-mark
>                         --cherry-pick
>                         --graph
> -                       --decorate --decorate=
> +                       --decorate --decorate= --no-decorate
>                         --walk-reflogs
> +                       --no-walk --no-walk= --do-walk
>                         --parents --children
> +                       --expand-tabs --expand-tabs= --no-expand-tabs
> +                       --patch
>                         $merge
>                         $__git_diff_common_options
>                         --pickaxe-all --pickaxe-regex
> @@ -2525,8 +2534,9 @@ _git_show ()
>                 return
>                 ;;
>         --*)
> -               __gitcomp "--pretty= --format= --abbrev-commit --oneline
> -                       --show-signature
> +               __gitcomp "--pretty= --format= --abbrev-commit --no-abbrev-commit
> +                       --oneline --show-signature --patch
> +                       --expand-tabs --expand-tabs= --no-expand-tabs
>                         $__git_diff_common_options
>                         "
>                 return
>
> --
> https://github.com/git/git/pull/426
>
Previous: Max RothmanNext: Max Rothman
Message 15 of 19 in “No log --no-decorate completion?”
  1. Max RothmanOct 11, 2017
  2. Stefan BellerOct 11, 2017
  3. Max RothmanOct 12, 2017
  4. Max RothmanOct 24, 2017
  5. Stefan BellerOct 24, 2017
  6. Max RothmanNov 2, 2017
  7. Stefan BellerNov 2, 2017
  8. Max RothmanNov 7, 2017
  9. Stefan BellerNov 7, 2017
  10. completion: add missing completions for log, diff, showMax Rothman, Nov 7, 2017
  11. Junio C HamanoNov 8, 2017
  12. Max RothmanNov 8, 2017
  13. Junio C HamanoNov 8, 2017
  14. completion: add missing completions for log, diff, showMax Rothman, Jul 2, 2019
  15. Max RothmanAug 2, 2019
  16. Max RothmanSep 11, 2019
  17. Johannes SchindelinSep 12, 2019
  18. Junio C HamanoSep 12, 2019
  19. Johannes SchindelinSep 13, 2019

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.