Re: [PATCH v4] tcsh-completion re-using git-completion.bash

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

Re: [PATCH v4] tcsh-completion re-using git-completion.bash

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:55:18

Marc Khouzam [off-list ref] writes:
The current tcsh-completion support for Git, as can be found on the
Internet, takes the approach of defining the possible completions
explicitly.  This has the obvious draw-back to require constant
updating as the Git code base evolves.
...
  C) Modifications:
          New git-completion.tcsh

     Provide a short tcsh script that generates another script
     which extends git-completion.bash.  This new script can be
     used by tcsh to perform completion.

     Pros:
       1- tcsh support is entirely isolated in git-completion.tcsh
       2- new tcsh script can be as complex as needed
     Cons (for tcsh users only):
       1- requires the user to copy both git-completion.tcsh and
          git-completion.bash to ${HOME}
       2- requires bash script to have a fixed name and location:
          ${HOME}/.git-completion.bash
       3- sourcing the new script will generate a third script

Approach (C) was selected avoid any modification to git-completion.bash.

Signed-off-by: Marc Khouzam <redacted>
---

As suggested, I put the 'sort | uniq' inside the script.
In that case, I don't need to worry about aliases since 'sort |uniq' will
be executed in bash, for which the tcsh user surely doesn't have aliases setup.
OK, so does this look OK to everybody (it does, looking at the
difference between v3 and this one, to me)?

The patch may deserve a Reviewed-by: by Felipe, by the way.  I can
add one while applying.

Thanks.

Re: [PATCH v4] tcsh-completion re-using git-completion.bash

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:55:18

On Fri, Nov 16, 2012 at 8:59 PM, Junio C Hamano [off-list ref] wrote:
Marc Khouzam [off-list ref] writes:
quoted
The current tcsh-completion support for Git, as can be found on the
Internet, takes the approach of defining the possible completions
explicitly.  This has the obvious draw-back to require constant
updating as the Git code base evolves.
...
  C) Modifications:
          New git-completion.tcsh

     Provide a short tcsh script that generates another script
     which extends git-completion.bash.  This new script can be
     used by tcsh to perform completion.

     Pros:
       1- tcsh support is entirely isolated in git-completion.tcsh
       2- new tcsh script can be as complex as needed
     Cons (for tcsh users only):
       1- requires the user to copy both git-completion.tcsh and
          git-completion.bash to ${HOME}
       2- requires bash script to have a fixed name and location:
          ${HOME}/.git-completion.bash
       3- sourcing the new script will generate a third script

Approach (C) was selected avoid any modification to git-completion.bash.

Signed-off-by: Marc Khouzam <redacted>
---

As suggested, I put the 'sort | uniq' inside the script.
In that case, I don't need to worry about aliases since 'sort |uniq' will
be executed in bash, for which the tcsh user surely doesn't have aliases setup.
OK, so does this look OK to everybody (it does, looking at the
difference between v3 and this one, to me)?

The patch may deserve a Reviewed-by: by Felipe, by the way.  I can
add one while applying.
That's fine by me.

Cheers.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help