Web lists-archives.com

Re: git silently ignores include directive with single quotes

Stas Bekman <stas@xxxxxxxxxx> writes:

> [include]
>     path = .gitconfig
> Not realizing that the two were not in the same folder. And probably
> assuming that .git/config was referring to the root of repository, and
> not relative to .git/, which is a reasonable assumption.
> Of course he had no way of resolving this as git wasn't telling him
> where it wasn't finding the file. i.e.
> Can't find: ~/myrepo/.git/.gitconfig
> which would have instantly told him where the problem was.

Yeah, I think Peff's idea of introducing a variant of include.path
that reports missing file would make sense for such a use case.

The code needs to turn a relative path to an absolute one by taking
the value as path relative to the including configuration file, so
we should already have the path to use in the error reporting, if we
were to go that route.