From 812a06a276e516ad8252856bf887f0190c8fd480 Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Wed, 4 Jun 2025 22:09:49 +0000
Subject: [PATCH] feat: Add `description` tag to the patch
The tag value is the patch subject
Signed-off-by: Awiteb
---
CHANGELOG.md | 2 ++
src/cli/commands/patch/mod.rs | 3 ++-
src/cli/commands/patch/send.rs | 1 +
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1ce7ca0..ea397f0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- New `patch send` command to send patches - by Awiteb
+- Add `alt` tag to the git issue - by Awiteb
+- Add `description` tag to the patch - by Awiteb
## [0.2.0] - 2025-06-01
diff --git a/src/cli/commands/patch/mod.rs b/src/cli/commands/patch/mod.rs
index 34066ad..e6a78b3 100644
--- a/src/cli/commands/patch/mod.rs
+++ b/src/cli/commands/patch/mod.rs
@@ -27,13 +27,14 @@ use super::{CliOptions, CommandRunner};
use crate::error::N34Result;
+/// Regular expression for extracting the patch subject.
static SUBJECT_RE: LazyLock =
LazyLock::new(|| Regex::new(r"(?m)^Subject: (.*(?:\n .*)*)").unwrap());
+/// Regular expression for extracting the patch body.
static BODY_RE: LazyLock =
LazyLock::new(|| Regex::new(r"\n\n((?:.|\n)*?)(?:\n--[ -]|\z)").unwrap());
-
#[derive(Subcommand, Debug)]
pub enum PatchSubcommands {
/// Send one or more patches to a repository
diff --git a/src/cli/commands/patch/send.rs b/src/cli/commands/patch/send.rs
index e64598f..b0e9c97 100644
--- a/src/cli/commands/patch/send.rs
+++ b/src/cli/commands/patch/send.rs
@@ -235,6 +235,7 @@ async fn make_patch(
// duplicate.
let mut safe_dedup_tags = Tags::new();
safe_dedup_tags.push(Tag::alt(format!("{PATCH_ALT_PREFIX}{}", patch.subject)));
+ safe_dedup_tags.push(Tag::description(patch.subject));
safe_dedup_tags.push(Tag::reference(euc.to_string()));
safe_dedup_tags.extend(content_details.into_tags());
safe_dedup_tags.extend(