Revision 5b12e3123b7b70e3875404a4ffe571ca079364fe authored by SZEDER Gábor on 24 June 2019, 18:13:18 UTC, committed by Junio C Hamano on 27 June 2019, 19:58:41 UTC
To make sure that the previously displayed progress line is completely
covered up when the new line is shorter, commit 545dc345eb (progress:
break too long progress bar lines, 2019-04-12) added a bunch of
calculations to figure out how many characters it needs to overwrite
with spaces.

Use the just introduced term_clear_line() helper function to, well,
clear the last line, making all these calculations unnecessary, and
thus simplifying the code considerably.

Three tests in 't5541-http-push-smart.sh' 'grep' for specific text
shown in the progress lines at the beginning of the line, but now
those lines begin either with the ANSI escape sequence or with the
terminal width worth of space characters clearing the line.  Relax the
'grep' patterns to match anywhere on the line.  Note that only two of
these three tests fail without relaxing their 'grep' pattern, but the
third looks for the absence of the pattern, so it still succeeds, but
without the adjustment would potentially hide future regressions.

Note also that with this change we no longer need the length of the
previously displayed progress line, so the strbuf added to 'struct
progress' in d53ba841d4 (progress: assemble percentage and counters in
a strbuf before printing, 2019-04-05) is not strictly necessary
anymore.  We still keep it, though, as it avoids allocating and
releasing a strbuf each time the progress is updated.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent d7d9088
History
File Mode Size
.gitignore -rw-r--r-- 7 bytes
README -rw-r--r-- 10.5 KB
TEAMS -rw-r--r-- 2.3 KB
bg.po -rw-r--r-- 872.1 KB
ca.po -rw-r--r-- 618.3 KB
de.po -rw-r--r-- 679.6 KB
el.po -rw-r--r-- 524.1 KB
es.po -rw-r--r-- 665.9 KB
fr.po -rw-r--r-- 680.1 KB
git.pot -rw-r--r-- 431.9 KB
is.po -rw-r--r-- 3.3 KB
it.po -rw-r--r-- 645.8 KB
ko.po -rw-r--r-- 557.6 KB
pt_PT.po -rw-r--r-- 482.9 KB
ru.po -rw-r--r-- 673.0 KB
sv.po -rw-r--r-- 690.3 KB
vi.po -rw-r--r-- 763.6 KB
zh_CN.po -rw-r--r-- 629.7 KB

README

back to top