MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / append_shadow_log

Function append_shadow_log

atomic-cli/src/commands/git/shadow.rs:2352–2367  ·  view source on GitHub ↗

Append one tagged `.atomic/hook-errors.log` line. Best-effort: log I/O errors are ignored (the operation already surfaces its own outcome).

(repo_root: &Path, tag: &str, view: &str, detail: &str)

Source from the content-addressed store, hash-verified

2350/// Append one tagged `.atomic/hook-errors.log` line. Best-effort: log I/O errors
2351/// are ignored (the operation already surfaces its own outcome).
2352fn append_shadow_log(repo_root: &Path, tag: &str, view: &str, detail: &str) {
2353 use std::io::Write;
2354 let log_path = repo_root.join(".atomic").join("hook-errors.log");
2355 let entry = format!(
2356 "{} {} view={} {}\n",
2357 chrono::Utc::now().to_rfc3339(),
2358 tag,
2359 view,
2360 detail
2361 );
2362 let _ = std::fs::OpenOptions::new()
2363 .create(true)
2364 .append(true)
2365 .open(&log_path)
2366 .and_then(|mut f| f.write_all(entry.as_bytes()));
2367}
2368
2369/// Return the first staged index path that is a git-excluded shadow / provenance
2370/// path (`.atomic/`, `.vault/`, or `.atomicignore`), or `None` if the candidate

Callers 3

acquire_shadow_lockFunction · 0.85

Calls 4

openMethod · 0.45
appendMethod · 0.45
createMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected