<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/progress.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-02-03T23:39:59Z</updated>
<entry>
<title>progress API: unify stop_progress{,_msg}(), fix trace2 bug</title>
<updated>2022-02-03T23:39:59Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-02-03T21:40:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=74900a6b3513e0908b1d16df7855e9d478b20b91'/>
<id>urn:sha1:74900a6b3513e0908b1d16df7855e9d478b20b91</id>
<content type='text'>
Fix a bug that's been with us ever since 98a13647408 (trace2: log
progress time and throughput, 2020-05-12), when the
stop_progress_msg() API was used we didn't log a "region_leave" for
the "region_enter" we start in "start_progress_delay()".

The only user of the "stop_progress_msg()" function is
"index-pack". Let's add a previously failing test to check that we
have the same number of "region_enter" and "region_leave" events, with
"-v" we'll log progress even in the test environment.

In addition to that we've had a submarine bug here introduced with
9d81ecb52b5 (progress: add sparse mode to force 100% complete message,
2019-03-21). The "start_sparse_progress()" API would only do the right
thing if the progress was ended with "stop_progress()", not
"stop_progress_msg()".

The only user of that API uses "stop_progress()", but let's still fix
that along with the trace2 issue by making "stop_progress()" a trivial
wrapper for "stop_progress_msg()".

We can also drop the "if (progress)" test from
"finish_if_sparse()". It's now a helper for the small
"stop_progress_msg()" function. We'll already have returned from it if
"progress" is "NULL".

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>progress.c: refactor stop_progress{,_msg}() to use helpers</title>
<updated>2022-02-03T23:39:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-02-03T21:40:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=accf1eb1d0f102c6b8f099fa6063216818e45c6b'/>
<id>urn:sha1:accf1eb1d0f102c6b8f099fa6063216818e45c6b</id>
<content type='text'>
Create two new static helpers for the stop_progress() and
stop_progress_msg() functions.

As we'll see in the subsequent commit having those two split up
doesn't make much sense, and results in a bug in how we log to
trace2. This narrow preparatory change makes the diff for that
subsequent change smaller.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>progress.c: use dereferenced "progress" variable, not "(*p_progress)"</title>
<updated>2022-02-03T23:39:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-02-03T21:40:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ccad6a1f175080c3896a70501dcd6c9e0a0af0a'/>
<id>urn:sha1:1ccad6a1f175080c3896a70501dcd6c9e0a0af0a</id>
<content type='text'>
Since 98a13647408 (trace2: log progress time and throughput,
2020-05-12) stop_progress() dereferences a "struct progress **"
parameter in several places. Extract a dereferenced variable to reduce
clutter and make it clearer who needs to write to this parameter.

Now instead of using "*p_progress" several times in stop_progress() we
check it once for NULL and then use a dereferenced "progress" variable
thereafter. This uses the same pattern as the adjacent
stop_progress_msg() function, see ac900fddb7f (progress: don't
dereference before checking for NULL, 2020-08-10).

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use CALLOC_ARRAY</title>
<updated>2021-03-14T00:00:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-03-13T16:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca56dadb4b65ccaeab809d80db80a312dc00941a'/>
<id>urn:sha1:ca56dadb4b65ccaeab809d80db80a312dc00941a</id>
<content type='text'>
Add and apply a semantic patch for converting code that open-codes
CALLOC_ARRAY to use it instead.  It shortens the code and infers the
element size automatically.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ma/stop-progress-null-fix'</title>
<updated>2020-08-18T00:02:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-08-18T00:02:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6ec620d8b2d576908889476eb7da716d2e4bda2'/>
<id>urn:sha1:e6ec620d8b2d576908889476eb7da716d2e4bda2</id>
<content type='text'>
NULL dereference fix.

* ma/stop-progress-null-fix:
  progress: don't dereference before checking for NULL
</content>
</entry>
<entry>
<title>progress: don't dereference before checking for NULL</title>
<updated>2020-08-10T21:59:57Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2020-08-10T19:47:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ac900fddb7fd3cc760ea5c1b79a50ad4564e4a0d'/>
<id>urn:sha1:ac900fddb7fd3cc760ea5c1b79a50ad4564e4a0d</id>
<content type='text'>
In `stop_progress()`, we're careful to check that `p_progress` is
non-NULL before we dereference it, but by then we have already
dereferenced it when calling `finish_if_sparse(*p_progress)`. And, for
what it's worth, we'll go on to blindly dereference it again inside
`stop_progress_msg()`.

We could return early if we get a NULL-pointer, but let's go one step
further and BUG instead. The progress API handles NULL just fine, but
that's the NULL-ness of `*p_progress`, e.g., when running with
`--no-progress`. If `p_progress` is NULL, chances are that's a mistake.
For symmetry, let's do the same check in `stop_progress_msg()`, too.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>progress: call trace2_region_leave() only after calling _enter()</title>
<updated>2020-05-15T16:41:30Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2020-05-15T16:09:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3af029c484fc72f546078966af538db55933e83d'/>
<id>urn:sha1:3af029c484fc72f546078966af538db55933e83d</id>
<content type='text'>
A user of progress API calls start_progress() conditionally and
depends on the display_progress() and stop_progress() functions to
become no-op when start_progress() hasn't been called.

As we added a call to trace2_region_enter() to start_progress(), the
calls to other trace2 API calls from the progress API functions must
make sure that these trace2 calls are skipped when start_progress()
hasn't been called on the progress struct.  Specifically, do not
call trace2_region_leave() from stop_progress() when we haven't
called start_progress(), which would have called the matching
trace2_region_enter().

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2: log progress time and throughput</title>
<updated>2020-05-12T22:30:39Z</updated>
<author>
<name>Emily Shaffer</name>
<email>emilyshaffer@google.com</email>
</author>
<published>2020-05-12T21:44:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98a136474082cdc7228d7e0e45672c5274fab701'/>
<id>urn:sha1:98a136474082cdc7228d7e0e45672c5274fab701</id>
<content type='text'>
Rather than teaching only one operation, like 'git fetch', how to write
down throughput to traces, we can learn about a wide range of user
operations that may seem slow by adding tooling to the progress library
itself. Operations which display progress are likely to be slow-running
and the kind of thing we want to monitor for performance anyways. By
showing object counts and data transfer size, we should be able to
make some derived measurements to ensure operations are scaling the way
we expect.

Signed-off-by: Emily Shaffer &lt;emilyshaffer@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>progress.c: silence cgcc suggestion about internal linkage</title>
<updated>2020-04-27T18:21:28Z</updated>
<author>
<name>Đoàn Trần Công Danh</name>
<email>congdanhqx@gmail.com</email>
</author>
<published>2020-04-27T14:22:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3cacb9aaf46cef6f9cd9b3a859fcc64416954b56'/>
<id>urn:sha1:3cacb9aaf46cef6f9cd9b3a859fcc64416954b56</id>
<content type='text'>
Signed-off-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Reviewed-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>progress: create GIT_PROGRESS_DELAY</title>
<updated>2019-11-27T01:57:10Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2019-11-25T21:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44a4693bfcec1876b29cdaec3625819d80ea1280'/>
<id>urn:sha1:44a4693bfcec1876b29cdaec3625819d80ea1280</id>
<content type='text'>
The start_delayed_progress() method is a preferred way to show
optional progress to users as it ignores steps that take less
than two seconds. However, this makes testing unreliable as tests
expect to be very fast.

In addition, users may want to decrease or increase this time
interval depending on their preferences for terminal noise.

Create the GIT_PROGRESS_DELAY environment variable to control
the delay set during start_delayed_progress(). Set the value
in some tests to guarantee their output remains consistent.

Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
