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

Re: [PATCH] tests: prefer host Git to verify chainlint self-checks

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2023, 15:11 UTC
Message-ID
<xmqqr0jqnnmn.fsf@gitster.g>
In-Reply-To
<ZXlbNlG28e1sAYPU@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
>> I do not think "prefer host Git" is necessarily a good idea; falling
>> back to use host Git is perfectly fine, of course.
>
> Why is that, though?

Mostly because your "differences in features supported by just-built one and what happens to be on $PATH can cause problems" cuts both ways, and as a general principle to work around such issues, using just-built one is a better discipline. The features the build infrastructure ("self-checks" being discussed is a part of it) of a particular version of Git source depends on are more likely to be found in the binary that will be built from the matching source, than what happens to be on $PATH that may be from a year-old version.

As you said, you'd need to accomodate need for those who are initially porting or building Git on a host without an installed one. If we were doing a cross build where just-built on would not be executable on the host, whatever version on $PATH (or in /usr/bin) may have to be used, but then in such a case you would not be testing on host anyway. For these two reasons, it is a given that one of the choices has to be to use just-built one. We can safely give lower precedence to the host tool.

The only one-and-half practical reasons we may want to fall back to whatever happens to be on $PATH are:

 - just-built one is so broken that even the simple use by the build
   infrastructure (like "self-checks") does not work (but then it
   becomes "if it is so broken, fix it before even thinking about
   running tests", and that is why I count it as half a reason), or
 - we are bisecting down to an ancient version, and just-built one
   from such a version may not understand the current repository.

so I do think it is an excellent workaround to fall back to a version of Git with unknown vintage that happens to be on $PATH, than failing and stopping by relying only on just-built one.

> We already use host Git in other parts of our build
> infra, and the options we pass to git-diff(1) have been around for ages:

It only argues for "trying host one, if available, before just-built one does not hurt for this particular case". But I was interested in laying out a more general principle we can follow in similar situations in the future.

Previous: Patrick SteinhardtNext: Eric Sunshine
Message 4 of 21 in “tests: prefer host Git to verify chainlint self-checks”
  1. tests: prefer host Git to verify chainlint self-checksPatrick Steinhardt, Dec 12, 2023
  2. Junio C HamanoDec 12, 2023
  3. Patrick SteinhardtDec 13, 2023
  4. Junio C HamanoDec 13, 2023
  5. Eric SunshineDec 14, 2023
  6. Patrick SteinhardtDec 14, 2023
  7. Eric SunshineDec 14, 2023
  8. Patrick SteinhardtDec 14, 2023
  9. Junio C HamanoDec 14, 2023
  10. Eric SunshineDec 14, 2023
  11. Junio C HamanoDec 14, 2023
  12. Patrick SteinhardtDec 15, 2023
  13. tests: adjust whitespace in chainlint expectationsPatrick Steinhardt, Dec 14, 2023
  14. Eric SunshineDec 14, 2023
  15. tests: adjust whitespace in chainlint expectationsPatrick Steinhardt, Dec 15, 2023
  16. Eric SunshineDec 15, 2023
  17. Patrick SteinhardtDec 15, 2023
  18. Eric SunshineDec 15, 2023
  19. tests: adjust whitespace in chainlint expectationsPatrick Steinhardt, Dec 15, 2023
  20. Eric SunshineDec 15, 2023
  21. Junio C HamanoDec 15, 2023

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.