summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--fleet/pkgs/naut/src/main.rs46
1 files changed, 30 insertions, 16 deletions
diff --git a/fleet/pkgs/naut/src/main.rs b/fleet/pkgs/naut/src/main.rs
index 6b2550c..361c212 100644
--- a/fleet/pkgs/naut/src/main.rs
+++ b/fleet/pkgs/naut/src/main.rs
@@ -141,26 +141,40 @@ async fn handle(
 
 				let commits: Vec<_> = walker
 					.map(|x| repo.find_commit(x.unwrap()).unwrap())
+					.filter(|c| {
+						// TODO(edef): we need a saner model here
+						// history that doesn't descend from the monorepo root shouldn't make it here at all
+						c.parents()
+							.next()
+							.map(|parent| {
+								let t1 = parent.tree().unwrap().get_name("ripple").map(|e| e.id());
+								let t2 = c.tree().unwrap().get_name("ripple").map(|e| e.id());
+								t1 != t2
+							})
+							.unwrap_or_default()
+					})
 					.collect();
 
-				lines.push(format!(
-					"{} {} pushed to {}",
-					commits.len(),
-					if commits.len() == 1 {
-						"commit"
-					} else {
-						"commits"
-					},
-					ref_name
-				));
-
-				for commit in commits {
+				if !commits.is_empty() {
 					lines.push(format!(
-						"  {} \"{}\" by {}",
-						commit.as_object().short_id()?.as_str().unwrap(),
-						commit.summary().unwrap(),
-						commit.author().name().unwrap()
+						"{} {} pushed to {}",
+						commits.len(),
+						if commits.len() == 1 {
+							"commit"
+						} else {
+							"commits"
+						},
+						ref_name
 					));
+
+					for commit in commits {
+						lines.push(format!(
+							"  {} \"{}\" by {}",
+							commit.as_object().short_id()?.as_str().unwrap(),
+							commit.summary().unwrap(),
+							commit.author().name().unwrap()
+						));
+					}
 				}
 			}
 		} else if r#ref.is_tag() {