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

Function parse_atomic_changes_trailer

atomic-cli/src/commands/git/parallel.rs:8460–8477  ·  view source on GitHub ↗

Parse **every** `Atomic-Changes:` trailer in a commit message. A GitHub (or GitLab/Azure) squash-merge concatenates the bodies of all squashed commits, so a single squash commit legitimately carries multiple** `Atomic-Changes:` blocks — one per materialization commit. We accumulate hashes across every block, de-duplicated with first-seen order preserved, so the ReviewGate links back to the *full*

(message: &str)

Source from the content-addressed store, hash-verified

8458/// [`split_atomic_changes_value`] splitter but must keep these distinct
8459/// notions of which trailers are relevant.
8460fn parse_atomic_changes_trailer(message: &str) -> Option<Vec<String>> {
8461 let mut all: Vec<String> = Vec::new();
8462 for line in message.lines() {
8463 let line = line.trim();
8464 if let Some(rest) = line.strip_prefix("Atomic-Changes:") {
8465 for hash in split_atomic_changes_value(rest) {
8466 if !all.contains(&hash) {
8467 all.push(hash);
8468 }
8469 }
8470 }
8471 }
8472 if all.is_empty() {
8473 None
8474 } else {
8475 Some(all)
8476 }
8477}
8478
8479/// Read one `Key: value` identity header from a commit message (the
8480/// record-projection header format; RFC §8.2).

Calls 5

linesMethod · 0.45
containsMethod · 0.45
pushMethod · 0.45
is_emptyMethod · 0.45