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

From: Junio C Hamano <[email-masked]>
Date: Fri, 13 Feb 2015 12:42:03 -0800

Daniel Finnie <[email-masked]> 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 prefix to them).

The input lines that come from --exclude-per-directory should go
through the prefixing, but -X=<file> makes that single file affect
the whole operation.  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 /var/tmp/exclude meant completely different
things, it would be crazy.