Skip to content

[1/1]: Stop spamming everyone with empty messages#54

Merged
slinder1 merged 1 commit into
mainfrom
users/slinder1/I00742310e87ee0d7ca9aa2174213cccff6b0ece2
Jun 24, 2026
Merged

[1/1]: Stop spamming everyone with empty messages#54
slinder1 merged 1 commit into
mainfrom
users/slinder1/I00742310e87ee0d7ca9aa2174213cccff6b0ece2

Conversation

@slinder1

@slinder1 slinder1 commented Jun 24, 2026

Copy link
Copy Markdown
Owner

The idea with the "Changes since last push: none" comments was to make
it clear that a force-push was just incidental to the stacking hack. In
practice a couple of rebases or changes in other commits in the stack
could lead to the comment being repeated several times in a short
period, which is understandably annoying.

I still think comments for actual interdiffs are useful enough to
retain.

Change-Id: I00742310e87ee0d7ca9aa2174213cccff6b0ece2


Stack:

(Note: Closed and merged PRs may not be reflected here and PR numbering is not stable.)

The idea with the "Changes since last push: none" comments was to make
it clear that a force-push was just incidental to the stacking hack. In
practice a couple of rebases or changes in other commits in the stack
could lead to the comment being repeated several times in a short
period, which is understandably annoying.

I still think comments for *actual interdiffs* are useful enough to
retain.

Change-Id: I00742310e87ee0d7ca9aa2174213cccff6b0ece2
@slinder1 slinder1 changed the title Stop spamming everyone with empty messages [1/1]: Stop spamming everyone with empty messages Jun 24, 2026
@slinder1

Copy link
Copy Markdown
Owner Author
🛠️ Initial changes (click to expand):
diff --git b/src/cgh.rs a/src/cgh.rs
@@ -152,6 +152,7 @@ fn push(cfg: &cli::Push) -> Result<()> {
     changes
         .par_iter()
         .zip(diffs)
+        .filter(|(c, _)| c.is_nonempty())
         .map(|(c, diff)| c.pr.add_details_comment(&diff))
         .collect::<Result<Vec<_>>>()
         .context("could not add interdiff comments")?;
diff --git b/src/gh.rs a/src/gh.rs
@@ -150,15 +150,14 @@ impl Pr {
     pub fn add_details_comment(&self, diff: &Diff) -> Result<()> {
         let (summary, changes) = match diff {
             Diff::InitialDiff(text) => ("Initial changes", text),
-            Diff::InterDiff(text) => ("Changes since last push", text),
-        };
-        let comment = if changes.is_empty() {
-            format!("🛠️ {summary}: none (likely a rebase)")
-        } else {
-            format!(
-                "<details>\n<summary>🛠️ {summary} (click to expand):</summary>\n\n```diff\n{changes}\n```\n</details>"
-            )
+            Diff::InterDiff(text) => ("Changes since last version", text),
         };
+        if changes.is_empty() {
+            return Ok(());
+        }
+        let comment = format!(
+            "<details>\n<summary>🛠️ {summary} (click to expand):</summary>\n\n```diff\n{changes}\n```\n</details>"
+        );
         let mut body_arg = ArgInlineOrFile::new("body");
         let mut cmd = gh();
         let args = self.args_for("comment", [body_arg.arg(comment)?]);

@slinder1 slinder1 marked this pull request as ready for review June 24, 2026 00:16
@slinder1 slinder1 merged commit e08daf3 into main Jun 24, 2026
1 check passed
@slinder1 slinder1 deleted the users/slinder1/I00742310e87ee0d7ca9aa2174213cccff6b0ece2 branch June 24, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant