Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gitcfg: rewrite the config parser to be path-agnostic
We have been running into configuraiton issues on platforms where the .gitconfig might be stored in a location that is opaque and unknown to cola a-priori. The root cause is that we read each config file separately, with three different "git config --file ..." calls, and this logic requires that we know *exactly* which config files we are going to read. Another downside to reading the config files one-at-a-time is that it requires three calls to "git". Rework the config reader so that it reads all of the configuration using a single call to "git config --show-origin --show-scope --list". "git config" will output the file paths that it reads when run this way, which alleviates cola from needing to know about the paths itself. Furthermore, this ensures that we will read the config value in all situations. The file paths are still used to maintain a cache (to prevent repeated calls to "git config") but they are no longer necessary for reading the values. Closes #927 Related-to: #1258 Related-to: #1263 Signed-off-by: David Aguilar <davvid@gmail.com>
- Loading branch information