Re: [PATCH v2 1/1] config: learn the "hostname:" includeIf condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ignacio Encinas <ignacio@xxxxxxxxxxxx> writes:

> +test_expect_success 'conditional include, hostname' '
> +	cat >>.git/config <<-EOF &&
> +	[includeIf "hostname:$(hostname)a"]

This unconditionally runs the $(hostname) command assuming it exists
everywhere, but

    $ git grep '$(hostname' t/
    t/t6500-gc.sh:	hostname=$(hostname || echo unknown) &&

tells us that we should be prepared to meet a platform where such a
command does not exist.

I have a feeling that it is better done with a test prerequisite
than hardcoded "unknown", as xgethostname() at C level may come up
with some random string but it is not guaranteed to be "unknown".

Perhaps have one instance of this before these added tests

	test_lazy_prereq WORKING_HOSTNAME '
		hostname >/dev/null 2>&1
	'

and then start them with

	test_expect_success WORKING_HOSTNAME 'hostname: includeIf' '
		...
	'

or something?  Others may think of a better way to make sure this
test does not cause false failures on platforms only because they
lack working hostname(1) but have a working gethostname(2) and their
xgethostname() may be working fine.

Thanks.






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux