{"thread":{"id":"52047","subject":"[RFC PATCH v1] t/README: the test repo does not have global or system configs","startedAt":"2019-10-16T12:45:24Z","lastAt":"2019-10-21T03:55:26Z","messageCount":5,"participants":["Philip Oakley","SZEDER Gábor","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"384184","messageId":"20191016124515.1807-1-philipoakley@iee.email","threadId":"52047","inReplyTo":null,"subject":"[RFC PATCH v1] t/README: the test repo does not have global or system configs","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-10-16T12:45:15Z","receivedAt":"2019-10-16T12:45:24Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Signed-off-by: Philip Oakley <philipoakley@iee.email>\n---\n\nWhile tring to get to grips with some Git-for-Windows config settings\nfor testing >4GiB files, I couldn't find any note in the readme about\nthe test system config file sources. \n\nIs this the right place for the information, is it complete enough,\nand is the default config template special?\n\n t/README | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/t/README b/t/README\nindex 60d5b77bcc..3daa1fa182 100644\n--- a/t/README\n+++ b/t/README\n@@ -485,6 +485,9 @@ This test harness library does the following things:\n    the --root option documented above, and a '.stress-<N>' suffix\n    appended by the --stress option.\n \n+ - The --global and --system config files are ignored, and\n+   a basic --local config is created in the tst repository.\n+\n  - Defines standard test helper functions for your scripts to\n    use.  These functions are designed to make all scripts behave\n    consistently when command line arguments --verbose (or -v),\n-- \n2.23.0.windows.1.21.g947f504ebe8.dirty\n\n"},{"id":"384188","messageId":"20191016164707.GW29845@szeder.dev","threadId":"52047","inReplyTo":"20191016124515.1807-1-philipoakley@iee.email","subject":"Re: [RFC PATCH v1] t/README: the test repo does not have global or system configs","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-10-16T16:47:07Z","receivedAt":"2019-10-16T16:47:14Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Wed, Oct 16, 2019 at 01:45:15PM +0100, Philip Oakley wrote:\n> Signed-off-by: Philip Oakley <philipoakley@iee.email>\n> ---\n> \n> While tring to get to grips with some Git-for-Windows config settings\n> for testing >4GiB files, I couldn't find any note in the readme about\n> the test system config file sources. \n\nThe path of the system config file is determined at compile time, with\nno way to override it at runtime.  Since we don't want external config\nfiles influencing our tests, the only choice we have is to ignore the\nsystem config file; that's why our test framework sets\nGIT_CONFIG_NOSYSTEM=1.\n\n> Is this the right place for the information, is it complete enough,\n> and is the default config template special?\n> \n>  t/README | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/t/README b/t/README\n> index 60d5b77bcc..3daa1fa182 100644\n> --- a/t/README\n> +++ b/t/README\n> @@ -485,6 +485,9 @@ This test harness library does the following things:\n>     the --root option documented above, and a '.stress-<N>' suffix\n>     appended by the --stress option.\n>  \n> + - The --global and --system config files are ignored, and\n> +   a basic --local config is created in the tst repository.\n\ns/tst/test/\n\nHowever, note that the global config file isn't really ignored, but\ndifferent.  The path of the global config file depends on the values\nof the env variables $XDG_CONFIG_HOME and $HOME, and, again, to avoid\nexternal influences, our test framework unsets the former, and\noverrides the latter with HOME=\"$TRASH_DIRECTORY\".  IOW the global\nconfig file in our tests is '.../t/trash directory.t1234-foo/.gitconfig'.\n\n> +\n>   - Defines standard test helper functions for your scripts to\n>     use.  These functions are designed to make all scripts behave\n>     consistently when command line arguments --verbose (or -v),\n> -- \n> 2.23.0.windows.1.21.g947f504ebe8.dirty\n> \n"},{"id":"384202","messageId":"dc8afd1b-2e69-e54d-aee9-e5d6c4b729f5@iee.email","threadId":"52047","inReplyTo":"20191016164707.GW29845@szeder.dev","subject":"Re: [RFC PATCH v1] t/README: the test repo does not have global or system configs","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-10-16T19:08:57Z","receivedAt":"2019-10-16T19:09:00Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 16/10/2019 17:47, SZEDER Gábor wrote:\n> On Wed, Oct 16, 2019 at 01:45:15PM +0100, Philip Oakley wrote:\n>> Signed-off-by: Philip Oakley <philipoakley@iee.email>\n>> ---\n>>\n>> While tring to get to grips with some Git-for-Windows config settings\n>> for testing >4GiB files, I couldn't find any note in the readme about\n>> the test system config file sources.\n> The path of the system config file is determined at compile time, with\n> no way to override it at runtime.  Since we don't want external config\n> files influencing our tests, the only choice we have is to ignore the\n> system config file; that's why our test framework sets\n> GIT_CONFIG_NOSYSTEM=1.\nThanks.\n>> Is this the right place for the information, is it complete enough,\n>> and is the default config template special?\n>>\n>>   t/README | 3 +++\n>>   1 file changed, 3 insertions(+)\n>>\n>> diff --git a/t/README b/t/README\n>> index 60d5b77bcc..3daa1fa182 100644\n>> --- a/t/README\n>> +++ b/t/README\n>> @@ -485,6 +485,9 @@ This test harness library does the following things:\n>>      the --root option documented above, and a '.stress-<N>' suffix\n>>      appended by the --stress option.\n>>   \n>> + - The --global and --system config files are ignored, and\n>> +   a basic --local config is created in the tst repository.\n> s/tst/test/\n>\n> However, note that the global config file isn't really ignored, but\n> different.  The path of the global config file depends on the values\n> of the env variables $XDG_CONFIG_HOME and $HOME, and, again, to avoid\n> external influences, our test framework unsets the former, and\n> overrides the latter with HOME=\"$TRASH_DIRECTORY\".  IOW the global\n> config file in our tests is '.../t/trash directory.t1234-foo/.gitconfig'.\nThanks\n>> +\n>>    - Defines standard test helper functions for your scripts to\n>>      use.  These functions are designed to make all scripts behave\n>>      consistently when command line arguments --verbose (or -v),\n>> -- \n>> 2.23.0.windows.1.21.g947f504ebe8.dirty\n>>\nI'll revise the text with this clarifying information (rephrased to man \npage style)\n\nPhilip\n"},{"id":"384380","messageId":"20191018140049.2183-1-philipoakley@iee.email","threadId":"52047","inReplyTo":"dc8afd1b-2e69-e54d-aee9-e5d6c4b729f5@iee.email","subject":"[PATCH v2] t/README: the test repo does not have global or system configs","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-10-18T14:00:49Z","receivedAt":"2019-10-18T14:00:59Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Also, fix minor wording mistake in referenced config section.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.email>\n---\nThe basic --local config also doesn't appear to be well defined here.\ntest-lib.sh sets GIT_TEMPLATE_DIR=\"$GIT_BUILD_DIR\"/templates/blt\nIf no config template then..? e.g. G-F-W\n[core]\n\trepositoryformatversion = 0\n\tfilemode = false\n\tbare = false\n\tlogallrefupdates = true\n\tsymlinks = false\n\tignorecase = true\n---\n Documentation/git-config.txt | 2 +-\n t/README                     | 7 +++++++\n 2 files changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\nindex 899e92a1c9..d4c792076d 100644\n--- a/Documentation/git-config.txt\n+++ b/Documentation/git-config.txt\n@@ -107,7 +107,7 @@ OPTIONS\n \tFor writing options: write to global `~/.gitconfig` file\n \trather than the repository `.git/config`, write to\n \t`$XDG_CONFIG_HOME/git/config` file if this file exists and the\n-\t`~/.gitconfig` file doesn't.\n+\t`~/.gitconfig` file if it doesn't.\n +\n For reading options: read only from global `~/.gitconfig` and from\n `$XDG_CONFIG_HOME/git/config` rather than from all available files.\ndiff --git a/t/README b/t/README\nindex 60d5b77bcc..71946902d7 100644\n--- a/t/README\n+++ b/t/README\n@@ -485,6 +485,13 @@ This test harness library does the following things:\n    the --root option documented above, and a '.stress-<N>' suffix\n    appended by the --stress option.\n \n+ - The test framework sets GIT_CONFIG_NOSYSTEM=1, thus ignoring any\n+   --system config files. The --global config is redirected through\n+   the environment variables. It unsets the $XDG_CONFIG_HOME variable\n+   and sets HOME=\"$TRASH_DIRECTORY\" for the tests.\n+   A basic --local config is created in the test repository.\n+   See linkgit:git-config[1].\n+\n  - Defines standard test helper functions for your scripts to\n    use.  These functions are designed to make all scripts behave\n    consistently when command line arguments --verbose (or -v),\n-- \n2.23.0.windows.1.21.g947f504ebe8.dirty\n\n"},{"id":"384491","messageId":"xmqqpniqlpli.fsf@gitster-ct.c.googlers.com","threadId":"52047","inReplyTo":"20191018140049.2183-1-philipoakley@iee.email","subject":"Re: [PATCH v2] t/README: the test repo does not have global or system configs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-21T03:55:21Z","receivedAt":"2019-10-21T03:55:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Philip Oakley <philipoakley@iee.email> writes:\n\n> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\n> index 899e92a1c9..d4c792076d 100644\n> --- a/Documentation/git-config.txt\n> +++ b/Documentation/git-config.txt\n> @@ -107,7 +107,7 @@ OPTIONS\n>  \tFor writing options: write to global `~/.gitconfig` file\n>  \trather than the repository `.git/config`, write to\n>  \t`$XDG_CONFIG_HOME/git/config` file if this file exists and the\n> -\t`~/.gitconfig` file doesn't.\n> +\t`~/.gitconfig` file if it doesn't.\n\nThe original is not easy to read, but this is not that much of an\nimprovement.  I think what the original wants to say is\n\n    - write to global `~/.gitconfig`\n\n    - but write to the XDG place instead, if XDG one exists and\n      ~/.gitconfig does not exist\n\nHow about touching a bit more, e.g.\n\n\tFor writing, rather than writing the per-repository config\n\tfile .git/config, write to the global config file, which is\n\t$XDG_CONFIG_HOME/git/config (if it exists), or\n\t$HOME/.gitconfig (otherwise).\n\nto streamline the description?\n\n> diff --git a/t/README b/t/README\n> index 60d5b77bcc..71946902d7 100644\n> --- a/t/README\n> +++ b/t/README\n> @@ -485,6 +485,13 @@ This test harness library does the following things:\n>     the --root option documented above, and a '.stress-<N>' suffix\n>     appended by the --stress option.\n>  \n> + - The test framework sets GIT_CONFIG_NOSYSTEM=1, thus ignoring any\n> +   --system config files. The --global config is redirected through\n> +   the environment variables. It unsets the $XDG_CONFIG_HOME variable\n> +   and sets HOME=\"$TRASH_DIRECTORY\" for the tests.\n> +   A basic --local config is created in the test repository.\n> +   See linkgit:git-config[1].\n\nCorrect, even though I would say s/thus ignoring/in order to ignore/\ninstead ;-)\n\nThanks.\n"}]}