From: Junio C Hamano Date: Mon, 11 Mar 2024 17:39:21 GMT Subject: Re: [PATCH v2 1/1] config: learn the "hostname:" includeIf condition Message-ID: In-Reply-To: <9fb02065-12d2-4c92-b1a5-74c06125c692@iencinas.com> Ignacio Encinas Rubio writes: > I can't think of any room for improvement other than integrating > hostname (or a custom hostname) into git and using it in the tests, but > I doubt it is worth it. Ah, that is a thought. We have t/helper that builds "test-tool" just for that, and exposing the output of xhostname() does sounds like a reasonable way to go. It would roughly involve * Add t/helper/test-xhostname.c that defines cmd__xhostname() and writes the result of calling xhostname() to its standard output. * Plumb it through by adding it to a few places: - t/helper/test-tool.h wants the extern definition. - t/helper/test-tool.c wants it in its cmds[] array. - Makefile wants to list it in TEST_BUILTIN_OBJS * Then use "test-tool xhostname" in your tests, instead of "hostname". You can run $ git grep chmtime ':!t/*.sh" to find places that needed to be touched when a similar internal tool "chmtime" was added.