Skip to content

feat(transfer): wire --info=BACKUP emission (3.4.1 parity)#4114

Merged
oferchen merged 1 commit into
masterfrom
feat/info-backup-emission-2164
May 16, 2026
Merged

feat(transfer): wire --info=BACKUP emission (3.4.1 parity)#4114
oferchen merged 1 commit into
masterfrom
feat/info-backup-emission-2164

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Wire --info=BACKUP producer in CopyContext::backup_existing_entry so the upstream INFO_GTE(BACKUP, 1) notice (backup.c:352: "backed up %s to %s") fires once a destination has been moved aside successfully.
  • The emission funnels through the single point that all local-copy backup callers converge on (regular file copy, symlink/fifo/device replacement, deletion-cleanup, source-orchestration), covering rename, replace-then-rename, and cross-device copy fallbacks.
  • Roll BACKUP from "Stub" to "Match" in 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)'
  • Existing backups.rs regression suite unaffected.

Closes #2164

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.
@github-actions github-actions Bot added the enhancement New feature or request label May 16, 2026
@oferchen oferchen merged commit 8bd6b1a into master May 16, 2026
19 checks passed
@oferchen oferchen deleted the feat/info-backup-emission-2164 branch May 16, 2026 00:50
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant