<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/progress.c, branch gitk-resize-error</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=gitk-resize-error</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=gitk-resize-error'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2021-03-14T00:00:09Z</updated>
<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='http://git.kilabit.info/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='http://git.kilabit.info/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='http://git.kilabit.info/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='http://git.kilabit.info/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='http://git.kilabit.info/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='http://git.kilabit.info/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='http://git.kilabit.info/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>
<entry>
<title>Test the progress display</title>
<updated>2019-09-17T16:39:16Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2019-09-16T20:54:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2bb74b53a49f92d433057f4d560b33f1fe2f770a'/>
<id>urn:sha1:2bb74b53a49f92d433057f4d560b33f1fe2f770a</id>
<content type='text'>
'progress.c' has seen a few fixes recently [1], and, unfortunately,
some of those fixes required further fixes [2].  It seems it's time to
have a few tests focusing on the subtleties of the progress display.

Add the 'test-tool progress' subcommand to help testing the progress
display, reading instructions from standard input and turning them
into calls to the display_progress() and display_throughput()
functions with the given parameters.

The progress display is, however, critically dependent on timing,
because it's only updated once every second or, if the toal is known
in advance, every 1%, and there is the throughput rate as well.  These
make the progress display far too undeterministic for testing as-is.
To address this, add a few testing-specific variables and functions to
'progress.c', allowing the the new test helper to:

  - Disable the triggered-every-second SIGALRM and set the
    'progress_update' flag explicitly based in the input instructions.
    This way the progress line will be updated deterministically when
    the test wants it to be updated.

  - Specify the time elapsed since start_progress() to make the
    throughput rate calculations deterministic.

Add the new test script 't0500-progress-display.sh' to check a few
simple cases with and without throughput, and that a shorter progress
line properly covers up the previously displayed line in different
situations.

[1] See commits 545dc345eb (progress: break too long progress bar
    lines, 2019-04-12) and 9f1fd84e15 (progress: clear previous
    progress update dynamically, 2019-04-12).
[2] 1aed1a5f25 (progress: avoid empty line when breaking the progress
    line, 2019-05-19)

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Revert "progress: use term_clear_line()"</title>
<updated>2019-09-17T16:39:16Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2019-09-16T20:54:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=bbf47568ad7e91ab0962b314c054a2da03232c72'/>
<id>urn:sha1:bbf47568ad7e91ab0962b314c054a2da03232c72</id>
<content type='text'>
This reverts commit 5b12e3123b (progress: use term_clear_line(),
2019-06-24), because covering up the entire last line while refreshing
the progress line caused unexpected problems during 'git
clone/fetch/push':

  $ git clone ssh://localhost/home/szeder/src/tmp/linux.git/
  Cloning into 'linux'...
  remote:
  remote:
  remote:
  remote: Enumerating objects: 999295

The length of the progress bar line can shorten when it includes
throughput and the unit changes, or when its length exceeds the width
of the terminal and is broken into two lines.  In these cases the
previously displayed longer progress line should be covered up,
because otherwise the leftover characters from the previous progress
line make the output look weird [1].  term_clear_line() makes this
quite simple, as it covers up the entire last line either by using an
ANSI control sequence or by printing a terminal width worth of space
characters, depending on whether the terminal is smart or dumb.

Unfortunately, when accessing a remote repository via any non-local
protocol the remote 'git receive-pack/upload-pack' processes can't
possibly have any idea about the local terminal (smart of dumb? how
wide?) their progress will end up on.  Consequently, they assume the
worst, i.e. standard-width dumb terminal, and print 80 spaces to cover
up the previously displayed progress line.  The local 'git
clone/fetch/push' processes then display the remote's progress,
including these coverup spaces, with the 'remote: ' prefix, resulting
in a total line length of 88 characters.  If the local terminal is
narrower than that, then the coverup gets line-wrapped, and after that
the CR at the end doesn't return to the beginning of the progress
line, but to the first column of its last line, resulting in those
repeated 'remote: &lt;many-spaces&gt;' lines.

By reverting 5b12e3123b (progress: use term_clear_line(),
2019-06-24) we won't cover up the entire last line, but go back to
comparing the length of the current progress bar line with the
previous one, and cover up as many characters as needed.

[1] See commits 545dc345eb (progress: break too long progress bar
    lines, 2019-04-12) and 9f1fd84e15 (progress: clear previous
    progress update dynamically, 2019-04-12).

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dr/progress-i18n'</title>
<updated>2019-07-11T22:16:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-07-11T22:16:49Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=ff2ea392f9ffc32fdce168b9325d30a27c397684'/>
<id>urn:sha1:ff2ea392f9ffc32fdce168b9325d30a27c397684</id>
<content type='text'>
Progress messages have been made localizable.

* dr/progress-i18n:
  l10n: localizable upload progress messages
</content>
</entry>
</feed>
