From: Wayne Davison Date: Tue, 22 Sep 2020 23:43:18 +0000 (-0700) Subject: Make the extra info on the "exists" messages optional. X-Git-Tag: v3.2.4pre1~121 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=740ed11aa82bb61022d927e669e3c79f704c941b;p=rsync.git Make the extra info on the "exists" messages optional. --- diff --git a/NEWS.md b/NEWS.md index 5254e6a9..d978222c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,16 +4,6 @@ ## Changes in this version: -### OUTPUT CHANGES: - - - Added a parenthetic suffix to the "FILENAME exists" output of - `--ignore-existing --info=skip` (note that `-vv` implies `--info=skip`). - The skip message is now "FILENAME exists (INFO)" where the INFO is one of - uptodate, type differs, or differs. The suffix may be omitted when using - `--checksum` unless `--info=skip2` was used (since we don't want to slow - down rsync with extra checksum operations unless the user really wants to - see the full difference info). - ### BUG FIXES: - Fix a bug with `--mkpath` if a single-file copy specifies an existing @@ -40,6 +30,10 @@ - Optimize the AVX2 checksum code a bit more. + - Added extra info to the "FILENAME exists" output of `--ignore-existing` when + `--info=skip2` is used. The skip message becomes "FILENAME exists (INFO)" + where the INFO is one of uptodate, type differs, or differs. + - Some manpage improvements. ### PACKAGING RELATED: diff --git a/generator.c b/generator.c index 2265f602..e3bc40a6 100644 --- a/generator.c +++ b/generator.c @@ -1378,15 +1378,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, if (ignore_existing > 0 && statret == 0 && (!is_dir || stype != FT_DIR)) { if (INFO_GTE(SKIP, 1) && is_dir >= 0) { - const char *suf; - if (ftype != stype) - suf = " (type differs)"; - else if (ftype == FT_REG && always_checksum > 0 && !INFO_GTE(SKIP, 2)) - suf = ""; /* skip quick-check checksum unless SKIP2 was specified */ - else if (quick_check_ok(ftype, fname, file, &sx.st)) - suf = " (uptodate)"; - else - suf = " (differs)"; + const char *suf = ""; + if (INFO_GTE(SKIP, 2)) { + if (ftype != stype) + suf = " (type differs)"; + else if (quick_check_ok(ftype, fname, file, &sx.st)) + suf = " (uptodate)"; + else + suf = " (differs)"; + } rprintf(FINFO, "%s exists%s\n", fname, suf); } #ifdef SUPPORT_HARD_LINKS diff --git a/rsync.1.md b/rsync.1.md index d205d0ba..ba79eb7a 100644 --- a/rsync.1.md +++ b/rsync.1.md @@ -1606,14 +1606,10 @@ your home directory (remove the '=' for that). permissions on the hard-linked files). This does mean that this option is only looking at the existing files in the destination hierarchy itself. - If `--info=skip` was specified (which is implied by `-vv`) then rsync - outputs a "FILENAME exists (INFO)" message where the INFO indicates one of - "uptodate", "type differs", or "differs". However, if you specified the - `--checksum` option, you must have specified `--info-skip2` to get the - "differs" or "uptodate" info since rsync will not take the extra time to - checksum these skipped files unless you really want it to (a parenthetical - suffix that is not "type differs" is elided if we are skipping the checksum - check for an existing file). + When `--info=skip2` is used rsync will output "FILENAME exists (INFO)" + messages where the INFO indicates one of "uptodate", "type differs", or + "differs". The first level of skip messages (which is also implied by + `-vv`) outputs the exists message without the "(INFO)" suffix. 0. `--remove-source-files`