From 4304b0f336ddba7b4ec6780795059ff2066d105b Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 17:33:17 +0000 Subject: comments: keep only what the code cannot show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stripped every comment that described what an item does, documented its arguments or fields, or cited the design docs (§n, I-n, m-n, decision n). 2247 comments down to 83. What survives: the section dividers that segment the large modules, the secret-handling warnings, the agent wire-frame directions, and the few notes without which the code they attach to reads as redundant, reorderable, or unsound. --- src/watch/mirror.rs | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/watch/mirror.rs') diff --git a/src/watch/mirror.rs b/src/watch/mirror.rs index b6f9c47..89c175d 100644 --- a/src/watch/mirror.rs +++ b/src/watch/mirror.rs @@ -6,21 +6,14 @@ use crate::db::{self, Db}; use crate::error::{Error, Result}; use crate::git; -/// Result of a cheap poll. `Unchanged` means we did **not** fetch — the poll is -/// `git ls-remote`, one request per pkgbase (§5.1). #[derive(Debug, Clone, PartialEq, Eq)] pub enum Sync { - /// Remote is gone (deleted from AUR). Gone, - /// `ls-remote` matched the local tip; no fetch performed. Unchanged { head: String }, - /// The tip moved; we fetched and now have `head`. Fetched { head: String, previous: Option }, - /// We had no local mirror yet. Cloned { head: String }, } -/// Ensure a mirror exists and is polled. Updates `pkgbase.aur_head`. pub fn sync_mirror(cfg: &Config, db: &Db, name: &str, url: &str) -> Result { let mirror = cfg.mirror_path(name); let known_head = db::get_pkgbase(db, name)?.and_then(|p| p.aur_head.clone()); @@ -52,15 +45,9 @@ fn record(db: &Db, name: &str, head: &str, mirror: &Path) -> Result<()> { db::set_aur_head(&db.writer, pb.id, head, &mirror.display().to_string()) } -/// A materialized snapshot tree: blob ids for hashing, text bodies for parsing -/// and diffing. #[derive(Debug, Clone)] pub struct Tree { - /// `(path, git blob id)` for every file in the tree — the input to - /// `recipe_hash`, which covers shipped patches too (§3). pub blobs: Vec<(String, String)>, - /// Text bodies, keyed by path. Binary files are omitted here but still - /// counted in `blobs`. pub files: BTreeMap, } @@ -79,10 +66,7 @@ impl Tree { } } -/// Read a commit's tree out of the mirror without touching the network. pub fn read_tree(mirror: &Path, commit: &str) -> Result { - // §16 mirror divergence: if a pin we are asked to read has vanished, that is - // a hard failure, not a silent re-pin. if !git::has_commit(mirror, commit) { return Err(Error::fail_closed(format!( "commit {commit} is missing from the local mirror; history was rewritten" @@ -104,8 +88,6 @@ fn looks_textual(b: &[u8]) -> bool { !b[..b.len().min(512)].contains(&0) } -/// Raw bytes of one file at a commit — used to hash sources shipped in the AUR -/// repo (§5.3 "local file shipped in the AUR repo"). pub fn read_file(mirror: &Path, commit: &str, path: &str) -> Result> { git::read_blob(mirror, commit, path) } -- cgit v1.2.3