Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Make git-commit complete both modified files and git-added files.
- X-seq: zsh-workers 23905
- From: Clint Adams <clint@xxxxxxx>
- To: Nikolai Weibull <now@xxxxxxxx>
- Subject: Re: Make git-commit complete both modified files and git-added files.
- Date: Thu, 4 Oct 2007 04:27:36 -0400
- Cc: Mikael Magnusson <mikachu@xxxxxxxxx>, zsh-workers <zsh-workers@xxxxxxxxxx>
- In-reply-to: <dbfc82860710040105o8d07bd3h784fa550f3b571ab@xxxxxxxxxxxxxx>
- Mail-followup-to: Nikolai Weibull <now@xxxxxxxx>, Mikael Magnusson <mikachu@xxxxxxxxx>, zsh-workers <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0710031805r1124449dmc4c55e7545a81e0a@xxxxxxxxxxxxxx> <dbfc82860710040105o8d07bd3h784fa550f3b571ab@xxxxxxxxxxxxxx>
On Thu, Oct 04, 2007 at 10:05:49AM +0200, Nikolai Weibull wrote:
> What do you need gitdir for?
He doesn't.
"files" is a pretty generic name for a tag.
Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.40
diff -u -r1.40 _git
--- Completion/Unix/Command/_git 4 Oct 2007 08:24:33 -0000 1.40
+++ Completion/Unix/Command/_git 4 Oct 2007 08:25:55 -0000
@@ -2627,8 +2627,7 @@
#this is for git-commit which can take files both git-added and not
(( $+functions[__git_changed_files] )) ||
__git_changed_files () {
- gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
- __git_command_successful || return
+ local -a files
files=(${(ps:\0:)"$(_call_program files git diff-index -z --name-only HEAD 2>/dev/null)"})
__git_command_successful || return
Messages sorted by:
Reverse Date,
Date,
Thread,
Author