git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Peter van der Does <peter@avirtualhome.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	git@vger.kernel.org, "SZEDER Gábor" <szeder@ira.uka.de>,
	"Marc Branchaud" <marcnarc@xiplink.com>,
	"Brian Gernhardt" <brian@gernhardtsoftware.com>,
	"Kevin Ballard" <kevin@sb.org>,
	"Mathias Lafeldt" <misfire@debugon.org>
Subject: Re: [PATCH v4 0/2] Make git-completion Bash 4 compatible
Date: Thu, 2 Dec 2010 09:16:13 -0500	[thread overview]
Message-ID: <20101202091613.6ac8f816@MonteCarlo.grandprix.int> (raw)
In-Reply-To: <20101202091624.GB1771@burratino>

On Thu, 2 Dec 2010 03:16:24 -0600
Jonathan Nieder <jrnieder@gmail.com> wrote:

> Hi again,
> 
> Peter van der Does wrote:
> 
> > Make git-completion Bash 4 compatible.
> 
> Thanks again for this work and sorry for all the fuss.
> 
> > Peter van der Does (2):
> >   Introduce functions from bash-completion project.
> 
> This patch introduces a minor regression in that it breaks the
> (already somewhat incomplete) zsh support.  Should be fixable by
> falling back to using COMP_WORDS on zsh.
> 
> >   Use the new functions to get the current cword.
> 
> This one introduces some subtle differences between commands and imho
> does more than it set out to do, by differentiating word splitting
> behavior between commands.  bash 3 was not splitting COMP_WORDS at
> equal signs or colons, ever.  Maybe we can start with that and then
> make refinements on top later.
> 
> While trying that out, I had an idea.  The patch depends on
> understanding the bash-completion library function introduced by patch
> 1, but I think we can avoid that by rearranging the patch series like
> this:
> 
>  1. If _get_comp_words_by_ref is already defined, use it to fetch
>     completion words.  Otherwise, just use COMP_WORDS (using a stub
>     _get_comp_words_by_ref), maintaining the current behavior.
>     [shown below]
> 
>  2. Import the definition of _get_comp_words_by_ref from the
>     bash-completion lib and use it if ZSH_VERSION is unset.
> 
>  3. Further refinements, if needed.
> 
> What do you think?
> 

I like the idea and we should go with this solution.

If by importing you mean using :
[CODE]. /git_bash_completion-functions[/CODE] in the
contrib/completion/git-completion.bash script, which would be the best
solution imho. The question is where to place that the function file.

This would also means changing the documentation inside the
git-completion.bash script, currently the instructions are:
[QUOTE]
# To use these routines:
#
#    1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
#    2) Added the following line to your .bashrc:
#        source ~/.git-completion.sh
[/QUOTE]

It would have to include copying the functions file somewhere as well.

Or we could use the method used now and include the functions in the
git-completion.bash script.

I'll be waiting for further feedback from Gábor, as he mentioned on the
list of he had some little changes to fix some minor nits and bugs
before completely implementing this solution.

-- 
Peter van der Does

GPG key: E77E8E98

IRC: Ganseki on irc.freenode.net
Twitter: @petervanderdoes

  reply	other threads:[~2010-12-02 14:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01 20:49 [PATCH v4 0/2] *** SUBJECT HERE *** Peter van der Does
2010-12-01 20:49 ` [PATCH v4 1/2] Introduce functions from bash-completion project Peter van der Does
2010-12-01 20:49 ` [PATCH v4 2/2] Use the new functions to get the current cword Peter van der Does
2010-12-02  7:45   ` Jonathan Nieder
2010-12-02 22:36   ` SZEDER Gábor
2010-12-01 21:09 ` [PATCH v4 0/2] Make git-completion Bash 4 compatible Jonathan Nieder
2010-12-02  1:10 ` SZEDER Gábor
2010-12-02  9:16 ` Jonathan Nieder
2010-12-02 14:16   ` Peter van der Does [this message]
2010-12-02 21:02     ` [RFC/PATCH 2/1] bash: eliminate dependency on bash_completion lib Jonathan Nieder
2010-12-02 23:40       ` SZEDER Gábor
2010-12-03  0:07         ` Jonathan Nieder
2010-12-03  8:02         ` Stephen Boyd
2010-12-07 16:07       ` SZEDER Gábor
2010-12-07 19:49         ` Jonathan Nieder
2010-12-07 20:41           ` SZEDER Gábor
2010-12-07 20:59             ` Jonathan Nieder
2010-12-07 21:03           ` Junio C Hamano
2010-12-15  6:24             ` [PATCH v5.1 0/3] Make git-completion Bash 4 compatible Jonathan Nieder
2010-12-15  6:26               ` [PATCH 1/3] bash: get --pretty=m<tab> completion to work with bash v4 Jonathan Nieder
2010-12-15  6:27               ` [PATCH 2/3] bash: simple reimplementation of _get_comp_words_by_ref Jonathan Nieder
2010-12-15  6:42               ` [MERGE PATCH 3/3] Merge branch 'master' (early part) into pd/bash-4-completion Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101202091613.6ac8f816@MonteCarlo.grandprix.int \
    --to=peter@avirtualhome.com \
    --cc=brian@gernhardtsoftware.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=kevin@sb.org \
    --cc=marcnarc@xiplink.com \
    --cc=misfire@debugon.org \
    --cc=spearce@spearce.org \
    --cc=szeder@ira.uka.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).