I am sending patches using git send-email .
I want that the email sent with the patch to have some additional text added at the top, besid
Documentation says that you can add --compose option to git send-email to "Invoke a text editor to edit an introductory message for the patch series."
If you want to automate this action and generate some text by your script. You could set $GIT_EDITOR environment variable to your script. It will receive temporary file name for the text in the command line argument. Contents of this file will be inserted into the message after your script exit.
Command for git send-email will look like:
$GIT_EDITOR="/path/to/your/script" git send-email ...
And your script could look like:
#!/bin/bash
echo "Your message" > $1