git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4 3/3] config: add '--show-origin' option to print the origin of a config value

From
Lars Schneider <larsxschneider@gmail.com>
Date
Feb 16, 2016, 09:51 UTC
Message-ID
<51832840-B879-4650-9DC5-E15EAA9919B9@gmail.com>
In-Reply-To
<56C253B8.1070702@ramsayjones.plus.com>
On 15 Feb 2016, at 23:39, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:
Show 29 quoted lines
> 
> 
> 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.

OK, I am happy to add the extra code. 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. 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?

Thanks, Lars

Previous: Ramsay JonesNext: Ramsay Jones
Message 20 of 32 in “config: add '--sources' option to print the source of a config value”
  1. 0/3 config: add '--sources' option to print the source of a config valuelarsxschneider@gmail.com, Feb 15, 2016
  2. 1/3 t: do not hide Git's exit code in testslarsxschneider@gmail.com, Feb 15, 2016
  3. Jeff KingFeb 15, 2016
  4. Lars SchneiderFeb 16, 2016
  5. 2/3 config: add 'type' to config_source struct that identifies config typelarsxschneider@gmail.com, Feb 15, 2016
  6. Jeff KingFeb 15, 2016
  7. Ramsay JonesFeb 16, 2016
  8. Ramsay JonesFeb 15, 2016
  9. Johannes SchindelinFeb 17, 2016
  10. Lars SchneiderFeb 18, 2016
  11. 3/3 config: add '--show-origin' option to print the origin of a config valuelarsxschneider@gmail.com, Feb 15, 2016
  12. Jeff KingFeb 15, 2016
  13. Eric SunshineFeb 15, 2016
  14. Jeff KingFeb 15, 2016
  15. Lars SchneiderFeb 17, 2016
  16. Junio C HamanoFeb 17, 2016
  17. Ramsay JonesFeb 15, 2016
  18. Jeff KingFeb 15, 2016
  19. Ramsay JonesFeb 15, 2016
  20. Lars SchneiderFeb 16, 2016
  21. Ramsay JonesFeb 16, 2016
  22. Jeff KingFeb 16, 2016
  23. Ramsay JonesFeb 16, 2016
  24. Jeff KingFeb 16, 2016
  25. Junio C HamanoFeb 15, 2016
  26. Lars SchneiderFeb 16, 2016
  27. Junio C HamanoFeb 15, 2016
  28. Jeff KingFeb 15, 2016
  29. Junio C HamanoFeb 15, 2016
  30. Lars SchneiderFeb 16, 2016
  31. Jeff KingFeb 15, 2016
  32. Lars SchneiderFeb 16, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.