{"record":{"id":"7eab7a6abe4bd1dd","repo":"gitbutlerapp/gitbutler","slug":"not-yet-implemented","errorCode":null,"errorMessage":"not yet implemented","messagePattern":"not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-core/src/snapshot/mod.rs","lineNumber":85,"sourceCode":"    /// Metadata attached to [`Commit`]s holding snapshots.\n    pub struct CommitMetadata {\n        /// The name of the operation that created the commit.\n        /// This is an internal string.\n        pub operation: String,\n        /// The title of the commit for user consumption, typically created using information from `trailers`.\n        pub title: String,\n        /// Properties to be stored with the commit.\n        pub trailers: Vec<CommitTrailer>,\n    }\n\n    /// Given a `snapshot_tree` as created by [`super::create_tree()`], associate it with the stash of `ref_name`.\n    /// If a stash already exists, put it on top, with a new commit to carry `metadata`.\n    pub fn create_stash_commit<'repo>(\n        _snapshot_tree: gix::Id<'repo>,\n        _ref_name: &gix::refs::FullNameRef,\n        _metadata: CommitMetadata,\n    ) -> anyhow::Result<Commit<'repo>> {\n        todo!()\n    }\n\n    /// List all stash commits available for `ref_name`, with the top-most (most recent) first, and the oldest one last.\n    pub fn list_stash_commits<'repo>(\n        _repo: &'repo gix::Repository,\n        _ref_name: &gix::refs::FullNameRef,\n    ) -> anyhow::Result<Vec<Commit<'repo>>> {\n        todo!()\n    }\n\n    /// List all references for which a stash is available.\n    /// Note that these might not actually exist in the `repo`, for instance if the actual reference was renamed.\n    pub fn list_stash_references(_repo: &gix::Repository) -> Vec<gix::refs::FullName> {\n        todo!()\n    }\n\n    /// Remove the top-most stash from the top of `ref_name` and write back all changes.\n    /// Just like Git, write merge conflicts and update the index, possibly update refs and metadata.","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-core/src/snapshot/mod.rs#L67-L103","documentation":"but-core's snapshot::create_stash_commit is a declared-but-unimplemented API: the body is todo!(), which panics with 'not yet implemented' when called. Its purpose is to create (or restack) the stash reference commit carrying CommitMetadata on top of an existing stash for the given reference.","triggerScenarios":"Any call to Snapshot::create_stash_commit in the current code — the function is a stub, so the first invocation panics unconditionally.","commonSituations":"Worktree snapshot/save flows that route through the stash API before the implementation landed; tests or CLI commands exercising stash creation; callers assuming the public API is complete because it compiles and is documented.","solutions":["Do not call create_stash_commit until it is implemented; check for alternative snapshot APIs in but-core.","Implement the function: build a stash commit on top of the existing stash ref (or create the ref) using _snapshot_tree and _metadata, matching the documented semantics.","If you own the calling code, gate the call behind a capability check or feature flag and return a proper error instead of panicking.","Convert todo!() to a typed anyhow::bail!(\"stash commit creation is not implemented\") so callers get a recoverable error.","Add a test that pins the expected behavior once implemented."],"exampleFix":"// before\n) -> anyhow::Result<Commit<'repo>> {\n    todo!()\n}\n// after\n) -> anyhow::Result<Commit<'repo>> {\n    anyhow::bail!(\"create_stash_commit is not yet implemented\")\n}","handlingStrategy":"try-catch","validationCode":"// treat the stub as unavailable until implemented\nfn stash_create_available() -> bool { false }\nif !stash_create_available() { return Err(StashUnavailable); }","typeGuard":"// Rust: capability probe instead of a type guard\nfn supports_stash_commit() -> bool {\n  // probe or version check; todo!() stubs have no safe probe today\n  false\n}","tryCatchPattern":"// today todo!() PANICS, so catch_unwind is required if you must call it\nlet result = std::panic::catch_unwind(|| {\n  Snapshot::create_stash_commit(tree, ref_name, metadata)\n});\nmatch result {\n  Ok(Ok(commit)) => apply(commit),\n  _ => fallback_snapshot_path()?,\n}","preventionTips":["Never assume a compiled public API is implemented; search the body for todo!()/unimplemented!().","Convert stubs to typed errors (anyhow::bail!) so callers can recover.","Gate features on capability checks, not on function existence.","Track stub APIs with issue references in doc comments.","Panic on stash paths aborts the host process — isolate via catch_unwind at boundaries."],"tags":["rust","unimplemented","panic"],"backgroundTag":"method-not-implemented","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}