chiark / gitweb /
tg-create.sh: Introduce topgit.{to,cc,bcc} config options
authorPetr Baudis <pasky@suse.cz>
Sun, 3 Aug 2008 18:30:03 +0000 (20:30 +0200)
committerPetr Baudis <pasky@suse.cz>
Sun, 3 Aug 2008 18:30:03 +0000 (20:30 +0200)
README
tg-create.sh

diff --git a/README b/README
index f914647ed7b59ff0798062f385de68caef1cf435..bd4f17a54d8b493e143469dd1e3d2a4eac9f07d1 100644 (file)
--- a/README
+++ b/README
@@ -203,7 +203,10 @@ tg create
        the current branch is assumed to be the only dependency.
 
        After `tg create`, you should insert the patch description
-       to the '.topmsg' file.
+       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'.
 
        The main task of `tg create` is to set up the topic branch
        base from the dependencies. This may fail due to merge conflicts.
@@ -306,6 +309,8 @@ mail headers are inserted and the patch itself is appended.
 Thus, as your patches evolve, you can record nuances like whether
 the paricular patch should have To-list/Cc-maintainer or vice
 versa and similar nuances, if your project is into that.
+From is prefilled from your current GIT_AUTHOR_IDENT, the To,
+Cc and Bcc can be prefilled from optional topgit.{to,cc,bcc}.
 
        .topdeps: Contains the one-per-line list of branches
 your patch depends on, pre-seeded with `tg create`. (Continuously
index 0db1cf376bdde093396a96cfd8df0eec8a96fd00..d196e4f5fa56bbba8de8034a9c5366c478879f49 100644 (file)
@@ -104,6 +104,9 @@ author="$(git var GIT_AUTHOR_IDENT)"
 author_addr="${author%> *}>"
 {
        echo "From: $author_addr"
+       ! 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] $1"
        echo
        cat <<EOT