git ls-files -X option is relative to repo root

2015-02-13 Thread Daniel Finnie
I encountered some unexpected behavior with Git today and was hoping to either a) clear up my misconception or b) make a bug report. My question deals with the --exclude-from option to git-ls-files. It appears that paths passed to this option are relative to the root of the repository, not your

Re: git ls-files -X option is relative to repo root

2015-02-13 Thread Junio C Hamano
Daniel Finnie d...@danfinnie.com writes: My question deals with the --exclude-from option to git-ls-files. You will be fine if you remember that these plumbing commands work by first cd'ing to the top-level of the working tree (and adjust the paths given from the command line by prefixing the

Re: git ls-files -X option is relative to repo root

2015-02-13 Thread Daniel Finnie
Hi Junio, Thanks for the info and backstory. I didn't realize that the paths in the file specified by --exclude-from would be relative to the project root. That makes my original use case kind of silly (it's a long story, but I was curious which files were ignored by a subset of my .gitignore

Re: git ls-files -X option is relative to repo root

2015-02-13 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: ... It does not make sense to allow where you are to affect behaviour of the command, i.e. in these two invocations of ls-files: git ls-files -X /var/tmp/exclude -i cd example git ls-files -X /var/tmp/exclude -i if the same line in

Re: git ls-files -X option is relative to repo root

2015-02-13 Thread Junio C Hamano
Daniel Finnie d...@danfinnie.com writes: Do you have any comments on why the path in --exclude-from=path is relative to the project root? Not really. Because ls-files was designed to be used by Porcelain scripts, and because the first thing Porcelain scripts are expected to do is to learn the