Skip to content

Commit 21f1f11

Browse files
authored
fix: add --log-format=%i to daemon args for itemize interop (#3083)
Upstream options.c:2750-2762 sends --log-format=%i to the server when the client is sender (push mode) and itemize-changes is enabled. This tells the daemon's receiver to emit itemize output via MSG_INFO frames. The SSH invocation path already included this arg, but the daemon argument builder (build_full_daemon_args) was missing it, causing oc:itemize interop test failures when pushing to an upstream daemon. Also removes oc:itemize and oc:merge-filter from KNOWN_FAILURES.
1 parent 09d3fff commit 21f1f11

3 files changed

Lines changed: 52 additions & 1 deletion

File tree

crates/core/src/client/remote/daemon_transfer/orchestration/arguments.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ pub(super) fn build_full_daemon_args(
158158
// --- Long-form arguments (upstream server_options() options.c:2737-2980) ---
159159
let we_are_sender = !is_sender;
160160

161+
// upstream: options.c:2750-2762 - server needs to know about log-format
162+
// so it can generate itemize output via MSG_INFO frames.
163+
// Only sent when client is sender (push) - matches upstream am_sender guard.
164+
if we_are_sender && config.itemize_changes() {
165+
args.push("--log-format=%i".to_owned());
166+
}
167+
161168
// --compress-level=N
162169
// upstream: options.c:2737-2740
163170
if let Some(level) = config.compression_level() {

crates/core/src/client/remote/daemon_transfer/orchestration/tests.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,51 @@ mod protect_args_daemon_tests {
173173
"pull mode should not send reference dir args to daemon: {args:?}"
174174
);
175175
}
176+
177+
#[test]
178+
fn build_full_args_includes_log_format_for_itemize_push() {
179+
// upstream: options.c:2750-2762 - --log-format=%i sent when am_sender
180+
// (client is sender / push mode) so daemon receiver emits itemize via MSG_INFO.
181+
let config = ClientConfig::builder().itemize_changes(true).build();
182+
let request = test_daemon_request();
183+
let protocol = ProtocolVersion::try_from(32u8).unwrap();
184+
// is_sender=false means daemon is NOT sender, i.e., client IS sender (push)
185+
let args = build_full_daemon_args(&config, &request, protocol, false);
186+
187+
assert!(
188+
args.iter().any(|a| a == "--log-format=%i"),
189+
"push with itemize should include --log-format=%i: {args:?}"
190+
);
191+
}
192+
193+
#[test]
194+
fn build_full_args_omits_log_format_for_itemize_pull() {
195+
// upstream: options.c:2752 - --log-format only sent when am_sender.
196+
// In pull mode (daemon is sender), client handles itemize locally.
197+
let config = ClientConfig::builder().itemize_changes(true).build();
198+
let request = test_daemon_request();
199+
let protocol = ProtocolVersion::try_from(32u8).unwrap();
200+
// is_sender=true means daemon IS sender (pull)
201+
let args = build_full_daemon_args(&config, &request, protocol, true);
202+
203+
assert!(
204+
!args.iter().any(|a| a == "--log-format=%i"),
205+
"pull with itemize should not include --log-format=%i: {args:?}"
206+
);
207+
}
208+
209+
#[test]
210+
fn build_full_args_omits_log_format_without_itemize() {
211+
let config = ClientConfig::default();
212+
let request = test_daemon_request();
213+
let protocol = ProtocolVersion::try_from(32u8).unwrap();
214+
let args = build_full_daemon_args(&config, &request, protocol, false);
215+
216+
assert!(
217+
!args.iter().any(|a| a.starts_with("--log-format")),
218+
"should not include --log-format without itemize: {args:?}"
219+
);
220+
}
176221
}
177222

178223
mod server_config_reference_dirs {

tools/ci/run_interop.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,6 @@ KNOWN_FAILURES=(
15021502
"oc:acls"
15031503
"oc:xattrs"
15041504
"oc:compress-lz4"
1505-
"oc:itemize"
15061505
# --- upstream→oc (daemon receive) ---
15071506
"up:acls"
15081507
"up:xattrs"

0 commit comments

Comments
 (0)