{"record":{"id":"6e5aea0e88fe4f00","repo":"jj-vcs/jj","slug":"scm-aware-watchman-clocks-not-supported","errorCode":null,"errorMessage":"SCM-aware Watchman clocks not supported","messagePattern":"SCM-aware Watchman clocks not supported","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/src/fsmonitor.rs","lineNumber":140,"sourceCode":"                }\n            };\n            Self(clock)\n        }\n    }\n\n    impl From<Clock> for crate::protos::local_working_copy::WatchmanClock {\n        fn from(clock: Clock) -> Self {\n            use crate::protos::local_working_copy::watchman_clock;\n            let Clock(clock) = clock;\n            let watchman_clock = match clock {\n                InnerClock::Spec(ClockSpec::StringClock(string_clock)) => {\n                    watchman_clock::WatchmanClock::StringClock(string_clock)\n                }\n                InnerClock::Spec(ClockSpec::UnixTimestamp(unix_timestamp)) => {\n                    watchman_clock::WatchmanClock::UnixTimestamp(unix_timestamp)\n                }\n                InnerClock::ScmAware(_) => {\n                    unimplemented!(\"SCM-aware Watchman clocks not supported\")\n                }\n            };\n            Self {\n                watchman_clock: Some(watchman_clock),\n            }\n        }\n    }\n\n    #[expect(missing_docs)]\n    #[derive(Debug, Error)]\n    pub enum Error {\n        #[error(\"Could not connect to Watchman\")]\n        WatchmanConnectError(#[source] watchman_client::Error),\n\n        #[error(\"Could not canonicalize working copy root path\")]\n        CanonicalizeRootError(#[source] std::io::Error),\n\n        #[error(\"Watchman failed to resolve the working copy root path\")]","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/jj-vcs/jj/blob/6631dbd4a85d5eb801aab321f7a9649ae3dc86ba/lib/src/fsmonitor.rs#L122-L158","documentation":"In lib/src/fsmonitor.rs, the From impl converting the internal fsmonitor clock into a Watchman clock hits InnerClock::ScmAware and calls unimplemented!(), producing a panic with message 'SCM-aware Watchman clocks not supported'. SCM-aware clocks are a newer Watchman clock flavor (they record source-control state alongside the timestamp) that jj's fsmonitor integration cannot translate into the plain watchman_clock::WatchmanClock representation, so conversion aborts.","triggerScenarios":"Constructing the fsmonitor clock type (or its From conversion) from an InnerClock::ScmAware(ClockSpec::ScmAware(..)) value — typically when parsing clock state persisted by a newer jj version or supplied via fsmonitor config/API that includes SCM-aware clock data, then converting it for the Watchman query.","commonSituations":"Downgrading jj after a newer version persisted an SCM-aware clock in repo state; sharing a working copy between jj versions where one writes ScmAware clocks; hand-crafting clock specs for testing with the scm-aware variant; Watchman environments where SCM-aware queries were enabled.","solutions":["Reset/clear the persisted fsmonitor clock state so a fresh plain clock is created instead of converting the SCM-aware one.","Use a jj version that supports SCM-aware Watchman clocks (upgrade to match whatever wrote the clock).","Avoid constructing InnerClock::ScmAware values in your code; map them to UnixTimestamp before conversion, discarding SCM state.","Disable the fsmonitor (Watchman) integration if SCM-aware clocks keep appearing in your environment."],"exampleFix":"// before\nlet clock = FsmonitorClock::from(inner); // inner is ScmAware(..) -> panic\n\n// after\nlet inner = match inner {\n    InnerClock::ScmAware(_) => InnerClock::Spec(ClockSpec::UnixTimestamp(now)),\n    other => other,\n};\nlet clock = FsmonitorClock::from(inner);","handlingStrategy":"fallback","validationCode":"// Normalize the clock before conversion:\nlet inner = if matches!(inner, InnerClock::ScmAware(_)) {\n    InnerClock::Spec(ClockSpec::UnixTimestamp(unix_now()))\n} else { inner };","typeGuard":"fn is_supported_clock(inner: &InnerClock) -> bool {\n    !matches!(inner, InnerClock::ScmAware(_))\n}","tryCatchPattern":"// unimplemented! panics; guard at boundary and fall back to a full scan:\nlet clock = if is_supported_clock(&inner) {\n    FsmonitorClock::from(inner)\n} else {\n    FsmonitorClock::fresh() // triggers full re-scan instead of incremental\n};","preventionTips":["Keep jj versions consistent across machines sharing a working copy.","Reset persisted fsmonitor clock state after downgrades.","If using Watchman SCM-aware features, pin a jj version that supports them or disable fsmonitor."],"tags":["rust","jujutsu","watchman","fsmonitor","unimplemented","version-mismatch"],"backgroundTag":"unsupported-clock-format","analyzedSha":"6631dbd4a85d5eb801aab321f7a9649ae3dc86ba","analyzedAt":"2026-08-28T15:03:31.143Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}