git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Lars Schneider <larsxschneider@gmail.com>
Cc: Jeff King <peff@peff.net>,
	git@vger.kernel.org, sschuberth@gmail.com,
	sunshine@sunshineco.com, hvoigt@hvoigt.net, sbeller@google.com,
	Johannes.Schindelin@gmx.de, gitster@pobox.com
Subject: Re: [PATCH v4 3/3] config: add '--show-origin' option to print the origin of a config value
Date: Tue, 16 Feb 2016 16:46:07 +0000	[thread overview]
Message-ID: <56C3524F.3000504@ramsayjones.plus.com> (raw)
In-Reply-To: <51832840-B879-4650-9DC5-E15EAA9919B9@gmail.com>



On 16/02/16 09:51, Lars Schneider wrote:
> 
> On 15 Feb 2016, at 23:39, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:
> 
>>
>>
>> On 15/02/16 21:40, Jeff King wrote:
>>> On Mon, Feb 15, 2016 at 09:36:23PM +0000, Ramsay Jones wrote:
>>>
>>>>> +test_expect_success '--show-origin stdin' '
>>>>> +	cat >expect <<-\EOF &&
>>>>> +		stdin:	user.custom=true
>>>>
>>>> So, as with the previous patch, I think this should be:
>>>> 		file:<stdin>	user.custom=true
>>>
>>> That's ambiguous with a file named "<stdin>", which was the point of
>>> having the two separate prefixes in the first place.
>>>
>>> I think in practice we _could_ get by with an ambiguous output (it's not
>>> like "<stdin>" is a common filename), but that was discussed earlier in
>>> the thread, and Lars decided to go for something unambiguous.
>>
>> sure, I just don't think it would cause a problem in practice.
>> How about using '-' for <stdin>? Hmm, you can actually create
>> such a file in the filesystem! Oh well, I guess its not a big deal.
>>
>>>
>>> That doesn't necessarily have to bleed over into the error messages,
>>> though (which could continue to use "<stdin>" if we want to put in a
>>> little extra code to covering the cases separately.
>>
>> Yep.

Sorry for not replying earlier - today has been hectic, so far.

> OK, I am happy to add the extra code. 

Unless I've missed something (quite possible), this patch does not
need to change. (you have (both) convinced me that your current
solution is the best).

The only change that I would suggest is the one-liner I already
suggested to the previous patch (plus the one-liner in the test,
of course. err ... so the two-liner!). Having said that, I didn't
try it out - I was just typing into my email client, so ...

>                                       However, out of curiosity, can
> you explain in what cases you actually use configs from stdin? I wasn't
> aware of this feature before working on this patch and I still wonder
> when I would use it.

Personally, I can't imagine ever using it. (I don't have a great
imagination. ;-)

Since I couldn't recall when this feature was added, I looked for
the commit that added it and found it was merged in commit 08f36302.
In particular, commit 3caec73b ("config: teach "git config --file -"
to read from the standard input", 19-02-2014) does not seem to
include any motivation for the change. The corresponding release
notes for v2.2.0 do not seem to add anything either.

So, I'm not much help here. :(

[Ah, looking at the date on the merge explains why I didn't
notice this.]

>                  If it is only a seldom used feature then I am not
> sure if adding the extra code to restore the existing error message
> is worth the effort?

ATB,
Ramsay Jones

  reply	other threads:[~2016-02-16 16:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15 10:17 [PATCH v4 0/3] config: add '--sources' option to print the source of a config value larsxschneider
2016-02-15 10:17 ` [PATCH v4 1/3] t: do not hide Git's exit code in tests larsxschneider
2016-02-15 17:41   ` Jeff King
2016-02-16  9:36     ` Lars Schneider
2016-02-15 10:17 ` [PATCH v4 2/3] config: add 'type' to config_source struct that identifies config type larsxschneider
2016-02-15 17:42   ` Jeff King
2016-02-16 22:07     ` Ramsay Jones
2016-02-15 21:30   ` Ramsay Jones
2016-02-17 13:12   ` Johannes Schindelin
2016-02-18  8:46     ` Lars Schneider
2016-02-15 10:17 ` [PATCH v4 3/3] config: add '--show-origin' option to print the origin of a config value larsxschneider
2016-02-15 18:06   ` Jeff King
2016-02-15 20:58   ` Eric Sunshine
2016-02-15 21:03     ` Jeff King
2016-02-17  8:32     ` Lars Schneider
2016-02-17 16:39       ` Junio C Hamano
2016-02-15 21:36   ` Ramsay Jones
2016-02-15 21:40     ` Jeff King
2016-02-15 22:39       ` Ramsay Jones
2016-02-16  9:51         ` Lars Schneider
2016-02-16 16:46           ` Ramsay Jones [this message]
2016-02-16 17:38             ` Jeff King
2016-02-16 22:14               ` Ramsay Jones
2016-02-16 22:17                 ` Jeff King
2016-02-15 21:41     ` Junio C Hamano
2016-02-16  9:48       ` Lars Schneider
2016-02-15 22:18   ` Junio C Hamano
2016-02-15 22:59     ` Jeff King
2016-02-15 23:56       ` Junio C Hamano
2016-02-16  9:52         ` Lars Schneider
2016-02-15 18:05 ` [PATCH v4 0/3] config: add '--sources' option to print the source " Jeff King
2016-02-16  9:40   ` Lars Schneider

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=56C3524F.3000504@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=larsxschneider@gmail.com \
    --cc=peff@peff.net \
    --cc=sbeller@google.com \
    --cc=sschuberth@gmail.com \
    --cc=sunshine@sunshineco.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).