<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/trace2.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-01-29T22:05:10Z</updated>
<entry>
<title>Merge branch 'am/trace2-with-valueless-true'</title>
<updated>2025-01-29T22:05:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-01-29T22:05:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5216a1bc68745ee81ba869adc6052ed892ebac1'/>
<id>urn:sha1:c5216a1bc68745ee81ba869adc6052ed892ebac1</id>
<content type='text'>
The trace2 code was not prepared to show a configuration variable
that is set to true using the valueless true syntax, which has been
corrected.

* am/trace2-with-valueless-true:
  trace2: prevent segfault on config collection with valueless true
</content>
</entry>
<entry>
<title>trace2: prevent segfault on config collection with valueless true</title>
<updated>2025-01-23T18:01:56Z</updated>
<author>
<name>Adam Murray</name>
<email>ad@canva.com</email>
</author>
<published>2025-01-10T07:28:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2fd367cf63cd5f94368340cc6fe1cd0a3fb021df'/>
<id>urn:sha1:2fd367cf63cd5f94368340cc6fe1cd0a3fb021df</id>
<content type='text'>
When TRACE2 analytics is enabled, a configuration variable set to
"valueless true" causes a segfault.

Steps to Reproduce

    GIT_TRACE2=true GIT_TRACE2_CONFIG_PARAMS=status.*
    git -c status.relativePaths version
    Expected Result
    git version 2.46.0
    Actual Result
    zsh: segmentation fault GIT_TRACE2=true

Add checks to prevent the segfault and instead show that the
variable without value.

Signed-off-by: Adam Murray &lt;ad@canva.com&gt;
Acked-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>global: mark code units that generate warnings with `-Wsign-compare`</title>
<updated>2024-12-06T11:20:02Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-06T10:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41f43b8243f42b9df2e98be8460646d4c0100ad3'/>
<id>urn:sha1:41f43b8243f42b9df2e98be8460646d4c0100ad3</id>
<content type='text'>
Mark code units that generate warnings with `-Wsign-compare`. This
allows for a structured approach to get rid of all such warnings over
time in a way that can be easily measured.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2: emit 'def_param' set with 'cmd_name' event</title>
<updated>2024-03-07T18:24:34Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhostetler@github.com</email>
</author>
<published>2024-03-07T15:22:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6111252cbf21abb175411da5c5a2cde65bb8f3e9'/>
<id>urn:sha1:6111252cbf21abb175411da5c5a2cde65bb8f3e9</id>
<content type='text'>
Some commands do not cause a set of 'def_param' events to be emitted.
This includes "git-remote-https", "git-http-fetch", and various
"query" commands, like "git --man-path".

Since all of these commands do emit a 'cmd_name' event, add code to
the "trace2_cmd_name()" function to generate the set of 'def_param'
events.

Remove explicit calls to "trace2_cmd_list_config()" and
"trace2_cmd_list_env_vars()" in git.c since they are no longer needed.

Reviewed-by: Josh Steadmon &lt;steadmon@google.com&gt;
Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2: avoid emitting 'def_param' set more than once</title>
<updated>2024-03-07T18:24:34Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhostetler@github.com</email>
</author>
<published>2024-03-07T15:22:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=520cf668149d43820a25869dc5f2eb7ff2ac5687'/>
<id>urn:sha1:520cf668149d43820a25869dc5f2eb7ff2ac5687</id>
<content type='text'>
During nested alias expansion it is possible for
"trace2_cmd_list_config()" and "trace2_cmd_list_env_vars()"
to be called more than once.  This causes a full set of
'def_param' events to be emitted each time.  Let's avoid
that.

Add code to those two functions to only emit them once.

Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'en/header-cleanup'</title>
<updated>2024-01-08T22:05:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-01-08T22:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=492ee03f60297e7e83d101f4519ab8abc98782bc'/>
<id>urn:sha1:492ee03f60297e7e83d101f4519ab8abc98782bc</id>
<content type='text'>
Remove unused header "#include".

* en/header-cleanup:
  treewide: remove unnecessary includes in source files
  treewide: add direct includes currently only pulled in transitively
  trace2/tr2_tls.h: remove unnecessary include
  submodule-config.h: remove unnecessary include
  pkt-line.h: remove unnecessary include
  line-log.h: remove unnecessary include
  http.h: remove unnecessary include
  fsmonitor--daemon.h: remove unnecessary includes
  blame.h: remove unnecessary includes
  archive.h: remove unnecessary include
  treewide: remove unnecessary includes in source files
  treewide: remove unnecessary includes from header files
</content>
</entry>
<entry>
<title>treewide: remove unnecessary includes in source files</title>
<updated>2023-12-26T20:04:31Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-12-23T17:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eea0e59ffbed6e33d171ace5be13cde9faa41639'/>
<id>urn:sha1:eea0e59ffbed6e33d171ace5be13cde9faa41639</id>
<content type='text'>
Each of these were checked with
   gcc -E -I. ${SOURCE_FILE} | grep ${HEADER_FILE}
to ensure that removing the direct inclusion of the header actually
resulted in that header no longer being included at all (i.e. that
no other header pulled it in transitively).

...except for a few cases where we verified that although the header
was brought in transitively, nothing from it was directly used in
that source file.  These cases were:
  * builtin/credential-cache.c
  * builtin/pull.c
  * builtin/send-pack.c

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2: redact passwords from https:// URLs by default</title>
<updated>2023-11-23T01:30:33Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2023-11-22T19:18:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b7d49ac1ecd05669edada26b990eee677a7d3c25'/>
<id>urn:sha1:b7d49ac1ecd05669edada26b990eee677a7d3c25</id>
<content type='text'>
It is an unsafe practice to call something like

	git clone https://user:password@example.com/

This not only risks leaking the password "over the shoulder" or into the
readline history of the current Unix shell, it also gets logged via
Trace2 if enabled.

Let's at least avoid logging such secrets via Trace2, much like we avoid
logging secrets in `http.c`. Much like the code in `http.c` is guarded
via `GIT_TRACE_REDACT` (defaulting to `true`), we guard the new code via
`GIT_TRACE2_REDACT` (also defaulting to `true`).

The new tests added in this commit uncover leaks in `builtin/clone.c`
and `remote.c`. Therefore we need to turn off
`TEST_PASSES_SANITIZE_LEAK`. The reasons:

- We observed that `the_repository-&gt;remote_status` is not released
  properly.

- We are using `url...insteadOf` and that runs into a code path where an
  allocated URL is replaced with another URL, and the original URL is
  never released.

- `remote_states` contains plenty of `struct remote`s whose refspecs
  seem to be usually allocated by never released.

More investigation is needed here to identify the exact cause and
proper fixes for these leaks/bugs.

Co-authored-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wrapper: use trace2 counters to collect fsync stats</title>
<updated>2023-07-20T18:52:53Z</updated>
<author>
<name>Beat Bolli</name>
<email>dev+git@drbeat.li</email>
</author>
<published>2023-07-20T16:48:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a27eecea75b3858b4052b191143f144a7e966869'/>
<id>urn:sha1:a27eecea75b3858b4052b191143f144a7e966869</id>
<content type='text'>
As mentioned in the thread starting at [1], trace2 counters should be
used to count events instead of ad-hoc static variables.

Convert the two fsync static variables to trace2 counters, reducing the
coupling between wrapper.c and the trace2 subsystem. Adjust t/t5351 to
match the trace2 counter output format.

The counters are not per-thread because the ones being replaced also
were not.

[1] https://lore.kernel.org/git/20230627195251.1973421-2-calvinwan@google.com/

Signed-off-by: Beat Bolli &lt;dev+git@drbeat.li&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2: plumb config kvi</title>
<updated>2023-06-28T21:06:39Z</updated>
<author>
<name>Glen Choo</name>
<email>chooglen@google.com</email>
</author>
<published>2023-06-28T19:26:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc9020849773393e47c37c2834a5582374b55ecc'/>
<id>urn:sha1:dc9020849773393e47c37c2834a5582374b55ecc</id>
<content type='text'>
There is a code path starting from trace2_def_param_fl() that eventually
calls current_config_scope(), and thus it needs to have "kvi" plumbed
through it. Additional plumbing is also needed to get "kvi" to
trace2_def_param_fl(), which gets called by two code paths:

- Through tr2_cfg_cb(), which is a config callback, so it trivially
  receives "kvi" via the "struct config_context ctx" parameter.

- Through tr2_list_env_vars_fl(), which is a high level function that
  lists environment variables for tracing. This has been secretly
  behaving like git_config_from_parameters() (in that it parses config
  from environment variables/the CLI), but does not set config source
  information.

  Teach tr2_list_env_vars_fl() to be well-behaved by using
  kvi_from_param(), which is used elsewhere for CLI/environment
  variable-based config.

As a result, current_config_scope() has no more callers, so remove it.

Signed-off-by: Glen Choo &lt;chooglen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
