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

Function append_shadow_log

atomic-cli/src/commands/git/shadow.rs:2164–2179  ·  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

2162/// Append one tagged `.atomic/hook-errors.log` line. Best-effort: log I/O errors
2163/// are ignored (the operation already surfaces its own outcome).
2164fn append_shadow_log(repo_root: &Path, tag: &str, view: &str, detail: &str) {
2165 use std::io::Write;
2166 let log_path = repo_root.join(".atomic").join("hook-errors.log");
2167 let entry = format!(
2168 "{} {} view={} {}\n",
2169 chrono::Utc::now().to_rfc3339(),
2170 tag,
2171 view,
2172 detail
2173 );
2174 let _ = std::fs::OpenOptions::new()
2175 .create(true)
2176 .append(true)
2177 .open(&log_path)
2178 .and_then(|mut f| f.write_all(entry.as_bytes()));
2179}
2180
2181/// Return the first staged index path that is a git-excluded shadow / provenance
2182/// 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