[llvm] [Github] Use format-patch instead of diff in prune-unused-branches (PR #181200)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 12 10:51:03 PST 2026


https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/181200

>From 525c5b4df8a805ae4d4837965a43e3c8c87aaec1 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Thu, 12 Feb 2026 18:32:06 +0000
Subject: [PATCH] [Github] Use format-patch instead of diff in
 prune-unused-branches

This preserves commit messages which some people said they would prefer
in the discourse post announcing this.
---
 .github/workflows/prune-unused-branches.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/prune-unused-branches.py b/.github/workflows/prune-unused-branches.py
index ac8d87f4241e0..54fdc44bd3712 100644
--- a/.github/workflows/prune-unused-branches.py
+++ b/.github/workflows/prune-unused-branches.py
@@ -73,7 +73,13 @@ def get_user_branches_to_remove(
 
 
 def generate_patch_for_branch(branch_name: str) -> bytes:
-    command_vector = ["git", "diff", f"origin/main...origin/{branch_name}"]
+    command_vector = [
+        "git",
+        "format-patch",
+        "--stdout",
+        "-k",
+        f"origin/main..origin/{branch_name}",
+    ]
     try:
         result = subprocess.run(
             command_vector, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True



More information about the llvm-commits mailing list