Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Make git-commit complete both modified files and git-added files.



On 10/4/07, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:

> +#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

What do you need gitdir for?

> +
> +  files=(${(ps:\0:)"$(_call_program files git diff-index -z
> --name-only HEAD 2>/dev/null)"})
> +  __git_command_successful || return
> +
> +  _wanted files expl 'index file' _multi_parts $@ - / files
> +}
> +
>  (( $+functions[__git_tree_files] )) ||
>  __git_tree_files () {
>    local multi_parts_opts



Messages sorted by: Reverse Date, Date, Thread, Author