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

Re: [PATCH] completion: add diff --color-moved[-ws]

From
Kirill Kolyshkin <kolyshkin@gmail.com>
Date
Feb 21, 2020, 20:15 UTC
Message-ID
<CAGmPdrwDUzk7iHYOrjPNrCJkhuJT==v5L-d_hY5gXxMLf+gFDQ@mail.gmail.com>
In-Reply-To
<CAHd-oW61vuuvs25iOkLJ--Wv39ZXFF87_-pV=vX=oTibRinn5Q@mail.gmail.com>

On Thu, 20 Feb 2020 at 15:30, Matheus Tavares Bernardino <matheus.bernardino@usp.br> wrote:

Show 26 quoted lines
>
> On Thu, Feb 20, 2020 at 6:47 PM Kir Kolyshkin <kolyshkin@gmail.com> wrote:
> >
> > These options are available since git v2.15, but somehow
> > eluded from the completion script.
> >
> > Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
> > ---
> >  contrib/completion/git-completion.bash | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> > index 1aac5a56c0..43cb6a312d 100644
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -1487,9 +1487,16 @@ __git_diff_algorithms="myers minimal patience histogram"
> >
> >  __git_diff_submodule_formats="diff log short"
> >
> > +__git_color_moved_opts="no default plain blocks zebra dimmed-zebra"
> > +
> > +__git_color_moved_ws_opts="no ignore-space-at-eol ignore-all-space
> > +                       allow-indentation-change"
>
> I think "ignore-space-change" is missing in the above list. Besides
> that, the patch LGTM.
Thanks for catching this, I'll send v2.
Show 6 quoted lines
>
> As a side-note: when we have an option with an already filled value,
> e.g. `--color-moved-ws=allow-identation-change,`, although it accepts
> more values as a comma separated list, pressing <tab><tab> won't
> suggest others. But I think the helper functions in
> git-completion.bash don't provide an easy way to do that right now

That's right -- as much as I want to make --key=val[,val ...] work, there is no (easy?) way to do that :(

Show 5 quoted lines
> (and there might even be a bug in bash-completion involving this [1]).
> So, I think the patch is good as it is (just adding the missing item
> to that list) :)
>
> [1]: https://github.com/scop/bash-completion/issues/240
Previous: Matheus Tavares BernardinoNext: Kir Kolyshkin
Message 4 of 8 in “completion: add diff --color-moved[-ws]”
  1. completion: add diff --color-moved[-ws]Kir Kolyshkin, Feb 20, 2020
  2. Matheus Tavares BernardinoFeb 20, 2020
  3. Matheus Tavares BernardinoFeb 21, 2020
  4. Kirill KolyshkinFeb 21, 2020
  5. completion: add diff --color-moved[-ws]Kir Kolyshkin, Feb 21, 2020
  6. Matheus TavaresFeb 23, 2020
  7. Kirill KolyshkinFeb 24, 2020
  8. Matheus Tavares BernardinoFeb 24, 2020

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.