Matt McCutchen
2008-Oct-22 06:05 UTC
[PATCH] Make progress output show "done" instead of "to-chk".
In incremental recursion mode, the number of files "to check" can increase (when new file-list chunks are built) as well as decrease, which I found confusing to watch. This patch makes the progress line show the number of files "done" (which increases monotonically) instead. I did notice that the last progress line shows "done=N-1/N" instead of "done=N/N"; that is perhaps unsettling but not really wrong. --- I'm sending this patch to the main rsync list rather than rsync-patches@mattmccutchen.net because others might want to express opinions on it. Matt progress.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/progress.c b/progress.c index 25be374..7309a5d 100644 --- a/progress.c +++ b/progress.c @@ -72,9 +72,9 @@ static void rprint_progress(OFF_T ofs, OFF_T size, struct timeval *now, if (is_last) { int len = snprintf(eol, sizeof eol, - " (xfr#%d, to-chk=%d/%d)\n", + " (xfr#%d, done=%d/%d)\n", stats.xferred_files, - stats.num_files - current_file_index - 1, + current_file_index, stats.num_files); if (INFO_GTE(PROGRESS, 2)) { static int last_len = 0; -- 1.6.0.2.593.g91df
Wayne Davison
2008-Nov-03 05:02 UTC
[PATCH] Make progress output show "done" instead of "to-chk".
On Wed, Oct 22, 2008 at 02:05:43AM -0400, Matt McCutchen wrote:> In incremental recursion mode, the number of files "to check" can > increase (when new file-list chunks are built) as well as decrease, > which I found confusing to watch. This patch makes the progress line > show the number of files "done" (which increases monotonically) > instead.I chose to display the to-check number because it is a more useful value to the user. It is easy to eye-ball with small transfers, but as the number of files increases, it becomes harder to mentally subtract the numbers to see how close we are to being done. Since an incremental transfer is increasing the number of total files as it finds new files to transfer, hopefully the user will see that it makes sense that the to-check value would also need to go up (even if they find it surprising at first). ..wayne..