All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars Schneider <larsxschneider@gmail.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: git@vger.kernel.org, peff@peff.net, ramsay@ramsayjones.plus.com,
	gitster@pobox.com, Johannes.Schindelin@gmx.de
Subject: Re: [PATCH v6 4/4] config: add '--show-origin' option to print the origin of a config value
Date: Mon, 21 Mar 2016 09:53:15 +0100	[thread overview]
Message-ID: <E8903192-701B-4EE9-B804-B612EAAF7A45@gmail.com> (raw)
In-Reply-To: <56D723F0.7020106@kdbg.org>


On 02 Mar 2016, at 18:33, Johannes Sixt <j6t@kdbg.org> wrote:

> 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

  parent reply	other threads:[~2016-03-21  8:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19  9:15 [PATCH v6 0/4] config: add '--sources' option to print the source of a config value larsxschneider
2016-02-19  9:15 ` [PATCH v6 1/4] t: do not hide Git's exit code in tests using 'nul_to_q' larsxschneider
2016-02-19  9:16 ` [PATCH v6 2/4] rename git_config_from_buf to git_config_from_mem larsxschneider
2016-02-19  9:16 ` [PATCH v6 3/4] config: add 'origin_type' to config_source struct larsxschneider
2016-02-19  9:16 ` [PATCH v6 4/4] config: add '--show-origin' option to print the origin of a config value larsxschneider
2016-02-22 17:43   ` Junio C Hamano
2016-02-22 17:58     ` Jeff King
2016-02-22 18:37       ` Junio C Hamano
2016-03-02 17:33   ` Johannes Sixt
2016-03-03  7:38     ` Lars Schneider
2016-03-03 18:36       ` Johannes Sixt
2016-03-22 14:44       ` Johannes Schindelin
2016-03-21  8:53     ` Lars Schneider [this message]
2016-02-19 18:26 ` [PATCH v6 0/4] config: add '--sources' option to print the source " Junio C Hamano
2016-02-22  9:23   ` [PATCH v6 squash 0/2] " larsxschneider
2016-02-22  9:23     ` [PATCH v7 1/2] fixup: config: add 'origin_type' to config_source struct larsxschneider
2016-02-22  9:23     ` [PATCH v7 2/2] fixup: config: add '--show-origin' option to print the origin of a config value larsxschneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E8903192-701B-4EE9-B804-B612EAAF7A45@gmail.com \
    --to=larsxschneider@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=peff@peff.net \
    --cc=ramsay@ramsayjones.plus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.