summaryrefslogtreecommitdiffstats
path: root/src/watch/mirror.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-19 17:09:59 +0000
committeraur-build <aur-build@localhost>2026-11-19 17:09:59 +0000
commite757979f1a2afdbe7146066345bb9acd19d3b151 (patch)
tree30d5f5fbccd25ea7bf01c5202684af463b74e7d3 /src/watch/mirror.rs
parent94c318f13264bb3c00a9f3057ba2e1aafb57c9e4 (diff)
downloadaur-build-e757979f1a2afdbe7146066345bb9acd19d3b151.tar.gz
aur-build-e757979f1a2afdbe7146066345bb9acd19d3b151.zip
comments: say why, not what
Every module-level `//!` header is gone, and the comments that remained either re-explained the line below them or had grown into paragraphs. Density went from one comment line per 6.7 lines of code to one per 10. 827 insertions against 2194 deletions across 86 files. What survived: the invariants (I1-I12), the design cross-references into DESIGN.md, and the notes recording a bug that was found and fixed — those are the comments that carry weight, because they answer a question the code cannot answer about itself. What did not: restating a function signature in prose, and narration of the statement underneath.
Diffstat (limited to 'src/watch/mirror.rs')
-rw-r--r--src/watch/mirror.rs14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/watch/mirror.rs b/src/watch/mirror.rs
index 989b968..b6f9c47 100644
--- a/src/watch/mirror.rs
+++ b/src/watch/mirror.rs
@@ -1,10 +1,3 @@
-//! The local AUR git mirror (§5.1).
-//!
-//! Clone, don't scrape. The mirror is load-bearing rather than a cache: every
-//! build materializes its recipe from it at the pinned commit and never asks
-//! the network for a recipe (§5.1a), so losing it would mean losing the ability
-//! to reproduce any historical release.
-
use std::collections::BTreeMap;
use std::path::Path;
@@ -64,11 +57,10 @@ fn record(db: &Db, name: &str, head: &str, mirror: &Path) -> Result<()> {
#[derive(Debug, Clone)]
pub struct Tree {
/// `(path, git blob id)` for every file in the tree — the input to
- /// `recipe_hash`. Covers PKGBUILD, .SRCINFO, *.install and shipped patches
- /// (§3): a patch file is part of the recipe.
+ /// `recipe_hash`, which covers shipped patches too (§3).
pub blobs: Vec<(String, String)>,
- /// Text bodies, keyed by path. Binary files are omitted from this map but
- /// still counted in `blobs`.
+ /// Text bodies, keyed by path. Binary files are omitted here but still
+ /// counted in `blobs`.
pub files: BTreeMap<String, String>,
}