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

Re: [PATCH 2/3] t6500: get hostname from "git var"

From
ICIsabella Caselli <bellacaselli20@gmail.com>
Date
Oct 13, 2026, 01:14 UTC
Message-ID
<CAK4AdTQNqp_B3kp_Be=2pLuX0bSfK_v59_AP5kHwh2YmfHYo_w@mail.gmail.com>
In-Reply-To
<xmqqecdu67zq.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
> "exercise the wrong case", meaning...  where hostname(1) output is
> different from "git var GIT_HOSTNAME" (aka xgethostname()), we would
> have written bogus name in .git/gc.pid file, simulating the case where
> gc.pid was written by a process running on a different machine.
>
> What is the implications of doing so?

If the hostnames differ, lock_repo_for_gc() assumes the lock belongs to a process on another machine. In that case, strcmp(locking_host, my_host) is already true, so the remaining conditions are never evaluated, such as !kill(pid, 0). So the test would still pass, but wouldn't actually check whether Git detects that the pid belongs to a running process on the same machine, which is the behavior it is meant to verify.

Should I adjust the commit message to clarify this?
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 15 in “hostname: includeIf condition — anyone already working on this?”
  1. Isabella CaselliSep 28, 2026
  2. Jeff KingSep 29, 2026
  3. Ignacio EncinasSep 29, 2026
  4. Jeff KingSep 29, 2026
  5. Junio C HamanoSep 29, 2026
  6. Isabella CaselliOct 2, 2026
  7. 0/3 Add hostname condition to includeIfIsabella Caselli, Oct 12, 2026
  8. 1/3 var: add GIT_HOSTNAMEIsabella Caselli, Oct 12, 2026
  9. 2/3 t6500: get hostname from "git var"Isabella Caselli, Oct 12, 2026
  10. Junio C HamanoOct 12, 2026
  11. Isabella CaselliOct 13, 2026
  12. Junio C HamanoOct 13, 2026
  13. 3/3 config: learn the "hostname:" includeIf conditionIsabella Caselli, Oct 12, 2026
  14. Junio C HamanoOct 12, 2026
  15. Jeff KingOct 14, 2026

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.