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:3957–3974  ·  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

3955/// [`split_atomic_changes_value`] splitter but must keep these distinct
3956/// notions of which trailers are relevant.
3957fn parse_atomic_changes_trailer(message: &str) -> Option<Vec<String>> {
3958 let mut all: Vec<String> = Vec::new();
3959 for line in message.lines() {
3960 let line = line.trim();
3961 if let Some(rest) = line.strip_prefix("Atomic-Changes:") {
3962 for hash in split_atomic_changes_value(rest) {
3963 if !all.contains(&hash) {
3964 all.push(hash);
3965 }
3966 }
3967 }
3968 }
3969 if all.is_empty() {
3970 None
3971 } else {
3972 Some(all)
3973 }
3974}
3975
3976/// Parse a PR/MR number from a commit message.
3977///

Calls 5

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