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

Function append_shadow_log

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

362/// Append one tagged `.atomic/hook-errors.log` line. Best-effort: log I/O errors
363/// are ignored (the operation already surfaces its own outcome).
364fn append_shadow_log(repo_root: &Path, tag: &str, view: &str, detail: &str) {
365 use std::io::Write;
366 let log_path = repo_root.join(".atomic").join("hook-errors.log");
367 let entry = format!(
368 "{} {} view={} {}\n",
369 chrono::Utc::now().to_rfc3339(),
370 tag,
371 view,
372 detail
373 );
374 let _ = std::fs::OpenOptions::new()
375 .create(true)
376 .append(true)
377 .open(&log_path)
378 .and_then(|mut f| f.write_all(entry.as_bytes()));
379}
380
381/// Return the first staged index path that is a git-excluded shadow / provenance
382/// path (`.atomic/`, `.vault/`, or `.atomicignore`), or `None` if the candidate

Callers 2

acquire_shadow_lockFunction · 0.85

Calls 3

openMethod · 0.45
createMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected