summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-01-21 13:24:04 -0800
committerSaul Wold <sgw@linux.intel.com>2011-01-24 14:09:13 -0800
commit94629f2521711055b412f954af19e48b9bda6e50 (patch)
tree4cb990507a1bdbbdf78a14a030d1532d7f383678
parent75748b6f09f459339bec6976fbf05e1eadc00d6c (diff)
downloadopenembedded-core-94629f2521711055b412f954af19e48b9bda6e50.tar.gz
openembedded-core-94629f2521711055b412f954af19e48b9bda6e50.tar.bz2
openembedded-core-94629f2521711055b412f954af19e48b9bda6e50.zip
send-pull-request: send all patches as the local user
When using sendmail to send patches, patches would appear to be from the original author as git adds a From: header in the generated patches. This patch changes this behavior to match that of git-send-email, where the email From: header is that of the current sender (according to sendmail) and a "From: Original Author <email>" line is inserted into the body of the message. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
-rwxr-xr-xscripts/send-pull-request7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/send-pull-request b/scripts/send-pull-request
index a66d4dc6d7..c08b3be078 100755
--- a/scripts/send-pull-request
+++ b/scripts/send-pull-request
@@ -144,13 +144,18 @@ if [ "$cont" == "y" ] || [ "$cont" == "Y" ]; then
# appending them to the sendmail command as -- $TO $CC has
# proven to be an exercise in futility.
#
+ # Clear the From header, leaving it up to sendmail to insert an
+ # appropriate one. Insert the original sender (per git) into the
+ # body of the message.
+ #
# Use tail to remove the email envelope from git or formail as
# msmtp (sendmail) would choke on them.
#
# Modify the patch date for sequential delivery, but retain the
# original date as "Old-Date".
DATE=$(date +"%a, %d %b %Y %k:%M:%S %z")
- cat $PATCH | formail -I "To: $TO" -I "CC: $CC" -i "Date: $DATE" | tail -n +2 | sendmail -t
+ GIT_FROM=$(cat $PATCH | formail -X "From:")
+ cat $PATCH | formail -I "To: $TO" -I "CC: $CC" -I "From:" -i "Date: $DATE" | sed "0,/^$/s/^$/\n$GIT_FROM\n/" | tail -n +2 | sendmail -t
if [ $? -eq 1 ]; then
ERROR=1
fi