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

Re: git silently ignores include directive with single quotes

From
SBStas Bekman <stas@stason.org>
Date
Sep 8, 2018, 20:58 UTC
Message-ID
<b1658700-dbec-f354-4979-5c3ab341af17@stason.org>
In-Reply-To
<877ejvraxh.fsf@evledraar.gmail.com>

On 2018-09-08 01:28 PM, Ævar Arnfjörð Bjarmason wrote: [...]

Show 10 quoted lines
> Yeah, some version of this is sensible. There's at least a doc patch in
> here somewhere, if not some "warn if missing" mode.
> 
> So don't take any of this as minimizing that aspect of your bug report.
> 
> *But*
> 
> There's just no way that "git" the tool can somehow in a sane way rescue
> you from knowing the quoting rules of the shell on your system, which
> differ wildly between the likes of Windows and Linux.

I understand. All your explanations are perfectly reasonable, Ævar. Thank you.

Yet, there needs to be some way for a user to know that git ignored something if their configuration doesn't work as expected.

1) I suggest this is done via:
  git config --list --show-origin

where the new addition would be to also show configuration parts that are not active and indicating why it is so.

So for example currently I get on a valid configuration setup and having git/../.gitconfig in place the following output:

[...] file:/home/stas/.gitconfig mergetool.prompt=false [...] file:.git/config include.path=../.gitconfig [...] file:.git/../.gitconfig filter.fastai-nbstripout-code.clean=tools/fastai-nbstripout [...]

Now, if include.path=../.gitconfig is there and file:.git/../.gitconfig is not found, it will indicate that in some way that stands out for the user. Perhaps:

[...] file:/home/stas/.gitconfig mergetool.prompt=false [...] file:.git/config include.path=../.gitconfig [...] file:.git/../.gitconfig FILE NOT FOUND! Ignored configuration [...]

So that would allow things to work as before, but now we have a way to debug user-side configuration. And of course hoping that the docs would indicate that method for debugging configuration problems.

I hope this is a reasonable suggestion that doesn't require any modification on the users' part who rely on this silent ignoring "feature", yet lending to a configuration debug feature.

2) And a secondary suggestion I mentioned earlier is to also have a flag
for git config to validate the path as it is being configured:
 git config --local include.path '../.gitconfig' --validate-path

so that on shells that deal with quoting differently, than what git expects, this git command will fail saying:

error: can't find file:.git/'../.gitconfig'

or at the very least give a warning if we don't want it be fatal. Though I see no problem with it being fatal if a user uses a special flag.

I made this second suggestion since it will help users to detect the problem early on. Before they need to search for another debug solution such as the first one suggested in this email.

3) Finally, it'd be useful to have GIT_TRACE=1 state that so and so
include path wasn't found and was ignored during various 'git whatever'
commands.

I am open to any or all of these solutions, or alternative suggestions of course.

Thank you.
-- 
________________________________________________
Stas Bekman       <'))))><       <'))))><
https://stasosphere.com  https://chestofbooks.com
https://experientialsexlab.com https://stason.org
https://stasosphere.com/experience-life/my-books
Previous: Ævar Arnfjörð BjarmasonNext: Paul Smith
Message 8 of 37 in “git silently ignores include directive with single quotes”
  1. Stas BekmanSep 8, 2018
  2. Martin ÅgrenSep 8, 2018
  3. Stas BekmanSep 8, 2018
  4. Stas BekmanSep 8, 2018
  5. Ævar Arnfjörð BjarmasonSep 8, 2018
  6. Stas BekmanSep 8, 2018
  7. Ævar Arnfjörð BjarmasonSep 8, 2018
  8. Stas BekmanSep 8, 2018
  9. Paul SmithSep 9, 2018
  10. Stas BekmanSep 9, 2018
  11. Ævar Arnfjörð BjarmasonSep 8, 2018
  12. Stas BekmanSep 8, 2018
  13. Ævar Arnfjörð BjarmasonSep 8, 2018
  14. Jeff KingSep 8, 2018
  15. Ramsay JonesSep 8, 2018
  16. Jeff KingSep 9, 2018
  17. Junio C HamanoSep 11, 2018
  18. Jeff KingSep 11, 2018
  19. Stas BekmanSep 23, 2018
  20. Ævar Arnfjörð BjarmasonSep 24, 2018
  21. Stas BekmanSep 24, 2018
  22. 0/1 Re: git silently ignores include directive with single quotesPhilip Oakley, Sep 24, 2018
  23. Stas BekmanSep 24, 2018
  24. 1/1 config doc: highlight the name=value syntaxPhilip Oakley, Sep 24, 2018
  25. Junio C HamanoSep 25, 2018
  26. Ævar Arnfjörð BjarmasonSep 8, 2018
  27. Jeff KingSep 9, 2018
  28. Jeff KingSep 8, 2018
  29. Stas BekmanSep 8, 2018
  30. Jeff KingSep 9, 2018
  31. Junio C HamanoSep 10, 2018
  32. Jonathan NiederSep 10, 2018
  33. Junio C HamanoSep 10, 2018
  34. Jonathan NiederSep 10, 2018
  35. Junio C HamanoSep 10, 2018
  36. Stas BekmanSep 10, 2018
  37. Junio C HamanoSep 10, 2018

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.