]> Kevux Git Server - rit/commit
test-tool: extend trace2 helper with 400ancestry
authorMatthew John Cheetham <mjcheetham@outlook.com>
Fri, 13 Feb 2026 19:54:59 +0000 (19:54 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Feb 2026 20:18:32 +0000 (12:18 -0800)
commitb6a125b936bfb05de704243e1fa568d4a9ad9a11
tree9e683918cbf9c46e2160b6bfe3a16582354d2772
parentd7301487a38766109589b02309dac1be6490fa95
test-tool: extend trace2 helper with 400ancestry

Add a new test helper "400ancestry" to the trace2 test-tool that
spawns a child process with a controlled trace2 environment, capturing
only the child's trace2 output (including cmd_ancestry events) in
isolation.

The helper clears all inherited GIT_TRACE2* variables in the child
and enables only the requested target (normal, perf, or event),
directing output to a specified file. This gives the test suite a
reliable way to capture cmd_ancestry events: the child always sees
"test-tool" as its immediate parent in the process ancestry, providing
a predictable value to verify in tests.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-trace2.c