Re: [PATCH v6 4/4] config: add '--show-origin' option to print the origin of a config value
- From
Lars Schneider <larsxschneider@gmail.com>
- Date
- Mar 21, 2016, 08:53 UTC
- Message-ID
- <E8903192-701B-4EE9-B804-B612EAAF7A45@gmail.com>
- In-Reply-To
- <56D723F0.7020106@kdbg.org>
On 02 Mar 2016, at 18:33, Johannes Sixt <j6t@kdbg.org> wrote:
Show 10 quoted lines
> Am 19.02.2016 um 10:16 schrieb larsxschneider@gmail.com: >> +test_expect_success '--show-origin with --list' ' >> + cat >expect <<-EOF && >> + file:$HOME/.gitconfig user.global=true >> + file:$HOME/.gitconfig user.override=global >> + file:$HOME/.gitconfig include.path=$INCLUDE_DIR/absolute.include > > On Windows, this injects POSIX-style paths in the expected output, but git.exe produces mangled paths (with a drive letter). The pattern I use to fix this is: > > file:$(pwd)/.gitconfig user.override=global
I tried that. But then I get this (notice the quotation marks):
-file:C:/git-sdk-64/usr/src/git/t/trash directory.t1300-repo-config/.gitconfig user.global=true +file:"C:\\git-sdk-64\\usr\\src\\git\\t\\trash directory.t1300-repo-config/.gitconfig" user.global=true
I am struggling to find a solution that works on all platforms. I see the following options:
(1) I detect MINGW in the test run and check for another string (2) I detect MINGW in the test run and change the output of 'git config --show-origin' with a regex (e.g. replace \\ with / and remote quotation marks) (3) I change the implementation of 'git config --show-origin' similar to [1]
If I get your comment ($gmane/288203) correctly then (3) wouldn't be a good idea. I think (1) would be the cleanest way. Do you have some pointers for me how Git for Windows solved these kind of problems in the past?
Thanks, Lars
[1] https://groups.google.com/forum/#!topic/git-for-windows/zTv60HhfnYk