Re: [RFC] Instruct git-completion.bash that we are in test mode

2013-01-22 Thread Junio C Hamano
Jean-Noël Avila writes: > Le 22/01/2013 05:31, Junio C Hamano a écrit : >> Jeff King writes: >> >>> I really hate to suggest this, but should it be more like: >>> >>> if test -z "$FAKE_COMMAND_LIST"; then __git_cmdlist() { git help -a >>> | egrep '^ [a-zA-Z0-9]' } else __git_cmdlist() { printf

Re: [RFC] Instruct git-completion.bash that we are in test mode

2013-01-22 Thread Jean-Noël Avila
Le 22/01/2013 05:31, Junio C Hamano a écrit : Jeff King writes: > >> I really hate to suggest this, but should it be more like: >> >> if test -z "$FAKE_COMMAND_LIST"; then __git_cmdlist() { git help -a >> | egrep '^ [a-zA-Z0-9]' } else __git_cmdlist() { printf '%s' >> "$FAKE_COMMAND_LIST" } fi

Re: [RFC] Instruct git-completion.bash that we are in test mode

2013-01-21 Thread Junio C Hamano
Jeff King writes: > I really hate to suggest this, but should it be more like: > > if test -z "$FAKE_COMMAND_LIST"; then > __git_cmdlist() { > git help -a | egrep '^ [a-zA-Z0-9]' > } > else > __git_cmdlist() { > printf '%s' "$

Re: [RFC] Instruct git-completion.bash that we are in test mode

2013-01-21 Thread Jeff King
On Mon, Jan 21, 2013 at 03:32:29PM -0800, Junio C Hamano wrote: > "Jean-Noël AVILA" writes: > > > At least, "it works for me". > > I suspect that your approach will still not fix the case in which > you build a branch with a new command git-check-ignore, and then > check out another branch that

Re: [RFC] Instruct git-completion.bash that we are in test mode

2013-01-21 Thread Junio C Hamano
"Jean-Noël AVILA" writes: > At least, "it works for me". I suspect that your approach will still not fix the case in which you build a branch with a new command git-check-ignore, and then check out another branch that does not yet have that command without first running "make clean". Does the f

[RFC] Instruct git-completion.bash that we are in test mode

2013-01-21 Thread Jean-Noël AVILA
In test mode, git completion should only propose core commands. Signed-off-by: Jean-Noel Avila --- I reworked the patch so that the test argument is only evaluated when sourcing the file and there is no environment clutter. At least, "it works for me". contrib/completion/git-completion.bash |