git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* [RFC PATCH v1] t/README: the test repo does not have global or system configs
@ 2019-10-16 12:45 Philip Oakley
  2019-10-16 16:47 ` SZEDER Gábor
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Oakley @ 2019-10-16 12:45 UTC (permalink / raw)
  To: GitList; +Cc: Philip Oakley

Signed-off-by: Philip Oakley <philipoakley@iee.email>
---

While tring to get to grips with some Git-for-Windows config settings
for testing >4GiB files, I couldn't find any note in the readme about
the test system config file sources. 

Is this the right place for the information, is it complete enough,
and is the default config template special?

 t/README | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/t/README b/t/README
index 60d5b77bcc..3daa1fa182 100644
--- a/t/README
+++ b/t/README
@@ -485,6 +485,9 @@ This test harness library does the following things:
    the --root option documented above, and a '.stress-<N>' suffix
    appended by the --stress option.
 
+ - The --global and --system config files are ignored, and
+   a basic --local config is created in the tst repository.
+
  - Defines standard test helper functions for your scripts to
    use.  These functions are designed to make all scripts behave
    consistently when command line arguments --verbose (or -v),
-- 
2.23.0.windows.1.21.g947f504ebe8.dirty


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH v1] t/README: the test repo does not have global or system configs
  2019-10-16 12:45 [RFC PATCH v1] t/README: the test repo does not have global or system configs Philip Oakley
@ 2019-10-16 16:47 ` SZEDER Gábor
  2019-10-16 19:08   ` Philip Oakley
  0 siblings, 1 reply; 5+ messages in thread
From: SZEDER Gábor @ 2019-10-16 16:47 UTC (permalink / raw)
  To: Philip Oakley; +Cc: GitList

On Wed, Oct 16, 2019 at 01:45:15PM +0100, Philip Oakley wrote:
> Signed-off-by: Philip Oakley <philipoakley@iee.email>
> ---
> 
> While tring to get to grips with some Git-for-Windows config settings
> for testing >4GiB files, I couldn't find any note in the readme about
> the test system config file sources. 

The path of the system config file is determined at compile time, with
no way to override it at runtime.  Since we don't want external config
files influencing our tests, the only choice we have is to ignore the
system config file; that's why our test framework sets
GIT_CONFIG_NOSYSTEM=1.

> Is this the right place for the information, is it complete enough,
> and is the default config template special?
> 
>  t/README | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/t/README b/t/README
> index 60d5b77bcc..3daa1fa182 100644
> --- a/t/README
> +++ b/t/README
> @@ -485,6 +485,9 @@ This test harness library does the following things:
>     the --root option documented above, and a '.stress-<N>' suffix
>     appended by the --stress option.
>  
> + - The --global and --system config files are ignored, and
> +   a basic --local config is created in the tst repository.

s/tst/test/

However, note that the global config file isn't really ignored, but
different.  The path of the global config file depends on the values
of the env variables $XDG_CONFIG_HOME and $HOME, and, again, to avoid
external influences, our test framework unsets the former, and
overrides the latter with HOME="$TRASH_DIRECTORY".  IOW the global
config file in our tests is '.../t/trash directory.t1234-foo/.gitconfig'.

> +
>   - Defines standard test helper functions for your scripts to
>     use.  These functions are designed to make all scripts behave
>     consistently when command line arguments --verbose (or -v),
> -- 
> 2.23.0.windows.1.21.g947f504ebe8.dirty
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH v1] t/README: the test repo does not have global or system configs
  2019-10-16 16:47 ` SZEDER Gábor
@ 2019-10-16 19:08   ` Philip Oakley
  2019-10-18 14:00     ` [PATCH v2] " Philip Oakley
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Oakley @ 2019-10-16 19:08 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: GitList

On 16/10/2019 17:47, SZEDER Gábor wrote:
> On Wed, Oct 16, 2019 at 01:45:15PM +0100, Philip Oakley wrote:
>> Signed-off-by: Philip Oakley <philipoakley@iee.email>
>> ---
>>
>> While tring to get to grips with some Git-for-Windows config settings
>> for testing >4GiB files, I couldn't find any note in the readme about
>> the test system config file sources.
> The path of the system config file is determined at compile time, with
> no way to override it at runtime.  Since we don't want external config
> files influencing our tests, the only choice we have is to ignore the
> system config file; that's why our test framework sets
> GIT_CONFIG_NOSYSTEM=1.
Thanks.
>> Is this the right place for the information, is it complete enough,
>> and is the default config template special?
>>
>>   t/README | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/t/README b/t/README
>> index 60d5b77bcc..3daa1fa182 100644
>> --- a/t/README
>> +++ b/t/README
>> @@ -485,6 +485,9 @@ This test harness library does the following things:
>>      the --root option documented above, and a '.stress-<N>' suffix
>>      appended by the --stress option.
>>   
>> + - The --global and --system config files are ignored, and
>> +   a basic --local config is created in the tst repository.
> s/tst/test/
>
> However, note that the global config file isn't really ignored, but
> different.  The path of the global config file depends on the values
> of the env variables $XDG_CONFIG_HOME and $HOME, and, again, to avoid
> external influences, our test framework unsets the former, and
> overrides the latter with HOME="$TRASH_DIRECTORY".  IOW the global
> config file in our tests is '.../t/trash directory.t1234-foo/.gitconfig'.
Thanks
>> +
>>    - Defines standard test helper functions for your scripts to
>>      use.  These functions are designed to make all scripts behave
>>      consistently when command line arguments --verbose (or -v),
>> -- 
>> 2.23.0.windows.1.21.g947f504ebe8.dirty
>>
I'll revise the text with this clarifying information (rephrased to man 
page style)

Philip

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] t/README: the test repo does not have global or system configs
  2019-10-16 19:08   ` Philip Oakley
@ 2019-10-18 14:00     ` " Philip Oakley
  2019-10-21  3:55       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Oakley @ 2019-10-18 14:00 UTC (permalink / raw)
  To: GitList, SZEDER Gábor; +Cc: Philip Oakley

Also, fix minor wording mistake in referenced config section.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
---
The basic --local config also doesn't appear to be well defined here.
test-lib.sh sets GIT_TEMPLATE_DIR="$GIT_BUILD_DIR"/templates/blt
If no config template then..? e.g. G-F-W
[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
---
 Documentation/git-config.txt | 2 +-
 t/README                     | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 899e92a1c9..d4c792076d 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -107,7 +107,7 @@ OPTIONS
 	For writing options: write to global `~/.gitconfig` file
 	rather than the repository `.git/config`, write to
 	`$XDG_CONFIG_HOME/git/config` file if this file exists and the
-	`~/.gitconfig` file doesn't.
+	`~/.gitconfig` file if it doesn't.
 +
 For reading options: read only from global `~/.gitconfig` and from
 `$XDG_CONFIG_HOME/git/config` rather than from all available files.
diff --git a/t/README b/t/README
index 60d5b77bcc..71946902d7 100644
--- a/t/README
+++ b/t/README
@@ -485,6 +485,13 @@ This test harness library does the following things:
    the --root option documented above, and a '.stress-<N>' suffix
    appended by the --stress option.
 
+ - The test framework sets GIT_CONFIG_NOSYSTEM=1, thus ignoring any
+   --system config files. The --global config is redirected through
+   the environment variables. It unsets the $XDG_CONFIG_HOME variable
+   and sets HOME="$TRASH_DIRECTORY" for the tests.
+   A basic --local config is created in the test repository.
+   See linkgit:git-config[1].
+
  - Defines standard test helper functions for your scripts to
    use.  These functions are designed to make all scripts behave
    consistently when command line arguments --verbose (or -v),
-- 
2.23.0.windows.1.21.g947f504ebe8.dirty


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] t/README: the test repo does not have global or system configs
  2019-10-18 14:00     ` [PATCH v2] " Philip Oakley
@ 2019-10-21  3:55       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2019-10-21  3:55 UTC (permalink / raw)
  To: Philip Oakley; +Cc: GitList, SZEDER Gábor

Philip Oakley <philipoakley@iee.email> writes:

> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
> index 899e92a1c9..d4c792076d 100644
> --- a/Documentation/git-config.txt
> +++ b/Documentation/git-config.txt
> @@ -107,7 +107,7 @@ OPTIONS
>  	For writing options: write to global `~/.gitconfig` file
>  	rather than the repository `.git/config`, write to
>  	`$XDG_CONFIG_HOME/git/config` file if this file exists and the
> -	`~/.gitconfig` file doesn't.
> +	`~/.gitconfig` file if it doesn't.

The original is not easy to read, but this is not that much of an
improvement.  I think what the original wants to say is

    - write to global `~/.gitconfig`

    - but write to the XDG place instead, if XDG one exists and
      ~/.gitconfig does not exist

How about touching a bit more, e.g.

	For writing, rather than writing the per-repository config
	file .git/config, write to the global config file, which is
	$XDG_CONFIG_HOME/git/config (if it exists), or
	$HOME/.gitconfig (otherwise).

to streamline the description?

> diff --git a/t/README b/t/README
> index 60d5b77bcc..71946902d7 100644
> --- a/t/README
> +++ b/t/README
> @@ -485,6 +485,13 @@ This test harness library does the following things:
>     the --root option documented above, and a '.stress-<N>' suffix
>     appended by the --stress option.
>  
> + - The test framework sets GIT_CONFIG_NOSYSTEM=1, thus ignoring any
> +   --system config files. The --global config is redirected through
> +   the environment variables. It unsets the $XDG_CONFIG_HOME variable
> +   and sets HOME="$TRASH_DIRECTORY" for the tests.
> +   A basic --local config is created in the test repository.
> +   See linkgit:git-config[1].

Correct, even though I would say s/thus ignoring/in order to ignore/
instead ;-)

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16 12:45 [RFC PATCH v1] t/README: the test repo does not have global or system configs Philip Oakley
2019-10-16 16:47 ` SZEDER Gábor
2019-10-16 19:08   ` Philip Oakley
2019-10-18 14:00     ` [PATCH v2] " Philip Oakley
2019-10-21  3:55       ` Junio C Hamano

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror http://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git