feat(transfer): wire --info=BACKUP emission (3.4.1 parity)#4114
Merged
Conversation
BACKUP sits at upstream's `INFO_GTE(BACKUP, 1)` gate but is not part
of any `info_verbosity[]` level, so it only fires when explicitly
enabled via `--info=BACKUP`. Upstream emits `"backed up %s to %s"`
from `backup.c:352` once the destination has been moved to its backup
location (regardless of which underlying path - rename, replace, or
cross-device copy - actually performed the move).
oc-rsync had the flag wired through CLI parsing but no producer. The
audit doc flagged this as "Stub" with the note: "no caller in
`crates/{engine,...}/src` issues an `info_gte`/`should_show_backup`
gate before emitting backup messages."
Funnel the emission through `CopyContext::backup_existing_entry`,
which is the single point all local-copy backup paths converge on
(file copy, symlink/fifo/device replacement, deletion-cleanup, and
source-orchestration backups). Emitting from the tail of the function
guarantees the notice fires only on a successful backup placement and
covers all three branches of the rename `match`. The `info_log!`
macro gates formatting behind `info_gte(Backup, 1)` so the call is a
no-op when the flag is disabled.
Two new tests assert byte-for-byte upstream wording and confirm that
the notice is suppressed when BACKUP is left at its default 0 level.
The audit doc rolls BACKUP from Stub to Match.
Closes #2164.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
BACKUP sits at upstream's `INFO_GTE(BACKUP, 1)` gate but is not part
of any `info_verbosity[]` level, so it only fires when explicitly
enabled via `--info=BACKUP`. Upstream emits `"backed up %s to %s"`
from `backup.c:352` once the destination has been moved to its backup
location (regardless of which underlying path - rename, replace, or
cross-device copy - actually performed the move).
oc-rsync had the flag wired through CLI parsing but no producer. The
audit doc flagged this as "Stub" with the note: "no caller in
`crates/{engine,...}/src` issues an `info_gte`/`should_show_backup`
gate before emitting backup messages."
Funnel the emission through `CopyContext::backup_existing_entry`,
which is the single point all local-copy backup paths converge on
(file copy, symlink/fifo/device replacement, deletion-cleanup, and
source-orchestration backups). Emitting from the tail of the function
guarantees the notice fires only on a successful backup placement and
covers all three branches of the rename `match`. The `info_log!`
macro gates formatting behind `info_gte(Backup, 1)` so the call is a
no-op when the flag is disabled.
Two new tests assert byte-for-byte upstream wording and confirm that
the notice is suppressed when BACKUP is left at its default 0 level.
The audit doc rolls BACKUP from Stub to Match.
Closes #2164.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
BACKUP sits at upstream's `INFO_GTE(BACKUP, 1)` gate but is not part
of any `info_verbosity[]` level, so it only fires when explicitly
enabled via `--info=BACKUP`. Upstream emits `"backed up %s to %s"`
from `backup.c:352` once the destination has been moved to its backup
location (regardless of which underlying path - rename, replace, or
cross-device copy - actually performed the move).
oc-rsync had the flag wired through CLI parsing but no producer. The
audit doc flagged this as "Stub" with the note: "no caller in
`crates/{engine,...}/src` issues an `info_gte`/`should_show_backup`
gate before emitting backup messages."
Funnel the emission through `CopyContext::backup_existing_entry`,
which is the single point all local-copy backup paths converge on
(file copy, symlink/fifo/device replacement, deletion-cleanup, and
source-orchestration backups). Emitting from the tail of the function
guarantees the notice fires only on a successful backup placement and
covers all three branches of the rename `match`. The `info_log!`
macro gates formatting behind `info_gte(Backup, 1)` so the call is a
no-op when the flag is disabled.
Two new tests assert byte-for-byte upstream wording and confirm that
the notice is suppressed when BACKUP is left at its default 0 level.
The audit doc rolls BACKUP from Stub to Match.
Closes #2164.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--info=BACKUPproducer inCopyContext::backup_existing_entryso the upstreamINFO_GTE(BACKUP, 1)notice (backup.c:352:"backed up %s to %s") fires once a destination has been moved aside successfully.docs/audits/info-flags-audit.md.Test plan
cargo nextest run -p engine --all-features -E 'test(backup_emits_info_backup_notice)'cargo nextest run -p engine --all-features -E 'test(backup_default_verbosity_suppresses_info_backup_notice)'backups.rsregression suite unaffected.Closes #2164