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 prefix and then cd to the root level of the working tree
before doing anything else, <path> that is relative to the root
level of the working tree ends up to be not so unnatural thing to be
used with --exclude-from=<path> (e.g. ".git/info/exclude").

If it were relative to whatever subdirectory the invoker of the
Porcelain script happened to be, Porcelain would have to do a lot
more (e.g. in "cd x/y && myPorcelain ../../.git/info/exclude", the
myPorcelain script would first have to learn the prefix is x/y, go
up two levels, and then strip two ../ from ../../.git/info/exclude
to turn it into .git/info/exclude when it runs ls-files).

So that is a convenience explanation in retrospect, but "Why" is
often a futile question to ask when talking about evolution, in
which whatever works gets picked.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to