On Sat, Dec 05, 2009 at 01:07:54PM +0100, ??t??p??n N??mec wrote: > No, this is wrong as far as I recall. At least this is better than current behavior. > I was solving the same problem before some time. Your solution (i.e. > git-diff-index --relative) only displays the changed files under a > subdirectory, which is incorrect when not in the repository root. Same problem exists for __git_*_files (__git_files). > I solved the problem by writing a 50 line or so "ueberfunction" which > manually relativizes the paths returned by git-diff-index to the correct > form required by git-commit You can get current subdirectory with "git rev-parse --show-prefix", then all "absolute" paths must be turned into relative. On my system there is "relative" program (comes with rpm-build package), so the code would look like: local -a rawfiles files local f prefix prefix=$(_call_program gitprefix git rev-parse --show-prefix 2>/dev/null) __git_command_successful || return rawfiles=( ... git ls-files or git diff-index call ... ) for f in $rawfiles; do files+=( $(relative /$prefix /$f) ) done _wanted ... Just need pure-zsh "relative" implementation. relative.c attached. P.S. I don't like this for loop. Can this be done with single expansion expression? -- Regards, Sir Raorn.