git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[TopGit PATCH 2/2] tg-create.sh: Introduce topgit.subjectprefix config option

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Aug 5, 2008, 19:13 UTC
Message-ID
<1217963610-15195-2-git-send-email-bert.wesarg@googlemail.com>
In-Reply-To
<1217963610-15195-1-git-send-email-bert.wesarg@googlemail.com>

Set the topgit.subjectprefix config option to prepend the string to the [PATCH] field in the Subject: line of the '.topmsg' file.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 README       |    7 ++++---
 tg-create.sh |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/README b/README
index bd4f17a..f821bab 100644
--- a/README
+++ b/README
@@ -204,9 +204,10 @@ tg create
 
 	After `tg create`, you should insert the patch description
 	to the '.topmsg' file, which will already contain some
-	pre-filled bits. You can set topgit.to, topgit.cc and topgit.bcc
-	configuration variables in order to have `tg create`
-	add these headers with given default values to '.topmsg'.
+	pre-filled bits. You can set topgit.subjectprefix, topgit.to,
+	topgit.cc and topgit.bcc configuration variables in order to
+	have `tg create` use this subject prefix and add these headers
+	with the given default values to '.topmsg', respectively.
 
 	The main task of `tg create` is to set up the topic branch
 	base from the dependencies. This may fail due to merge conflicts.
diff --git a/tg-create.sh b/tg-create.sh
index 0bf329c..c2b38bf 100644
--- a/tg-create.sh
+++ b/tg-create.sh
@@ -107,7 +107,8 @@ author_addr="${author%> *}>"
 	! header="$(git config topgit.to)" || echo "To: $header"
 	! header="$(git config topgit.cc)" || echo "Cc: $header"
 	! header="$(git config topgit.bcc)" || echo "Bcc: $header"
-	echo "Subject: [PATCH] $name"
+	subject_prefix="$(git config topgit.subjectprefix)" && subject_prefix="$subject_prefix "
+	echo "Subject: [${subject_prefix}PATCH] $name"
 	echo
 	cat <<EOT
 <patch description>
-- 
tg: (2fc069d..) t/subject-prefix (depends on: t/fix-subject-line-in-.topmsg)
Previous: Bert WesargNext: Petr Baudis
Message 2 of 5 in “Fix generated Subject: line in .topmsg”
  1. 1/2 Fix generated Subject: line in .topmsgBert Wesarg, Aug 5, 2008
  2. 2/2 tg-create.sh: Introduce topgit.subjectprefix config optionBert Wesarg, Aug 5, 2008
  3. Petr BaudisAug 5, 2008
  4. Bert WesargAug 6, 2008
  5. Bert WesargAug 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.