summaryrefslogtreecommitdiff
path: root/trace2/tr2_sid.h
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder.dev@gmail.com>2019-06-24 20:13:18 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-06-27 12:58:41 -0700
commit5b12e3123b7b70e3875404a4ffe571ca079364fe (patch)
treeeed88958e7b41500d9ad4ff4aaf8da705c1878fd /trace2/tr2_sid.h
parentrebase: fix garbled progress display with '-x' (diff)
downloadtgif-5b12e3123b7b70e3875404a4ffe571ca079364fe.tar.xz
progress: use term_clear_line()
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>
Diffstat (limited to 'trace2/tr2_sid.h')
0 files changed, 0 insertions, 0 deletions