All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/send-pull-request: Use git send-mail instead of sendmail
@ 2010-12-21  9:39 Khem Raj
  2010-12-21 21:19 ` Darren Hart
  2010-12-22  0:28 ` Darren Hart
  0 siblings, 2 replies; 8+ messages in thread
From: Khem Raj @ 2010-12-21  9:39 UTC (permalink / raw)
  To: poky

* usually git send-mail is setup by people using git
  so use git send-mail to post patches for pull requests
  There is how to setup git send-email
  see section "Set up git"
  http://www.openembedded.org/index.php/How_to_submit_a_patch_to_OpenEmbedded

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 scripts/send-pull-request |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/scripts/send-pull-request b/scripts/send-pull-request
index 0576a5d..2f0b90d 100755
--- a/scripts/send-pull-request
+++ b/scripts/send-pull-request
@@ -12,8 +12,8 @@ Usage: $(basename $0) [-h] [-a] [[-t email]...] -p pull-dir
 EOM
 }
 
-# Collect To and CC addresses from the patch files if they exist
-# $1: Which header to add the recipients to, "TO" or "CC"
+# Collect To, From and CC addresses from the patch files if they exist
+# $1: Which header to add the recipients to, "TO", "FROM" or "CC"
 # $2: The regex to match and strip from the line with email addresses
 harvest_recipients()
 {
@@ -27,6 +27,8 @@ harvest_recipients()
                 if [ -z "$TO" ]; then TO=$EMAIL; else TO="$TO,$EMAIL"; fi
             elif [ "$TO_CC" == "CC" ] && [ "${CC/$EMAIL/}" == "$CC" ] && [ -n "$EMAIL" ]; then
                 if [ -z "$CC" ]; then CC=$EMAIL; else CC="$CC,$EMAIL"; fi
+            elif [ "$TO_CC" == "FROM" ] && [ "${FROM/$EMAIL/}" == "$FROM" ] && [ -n "$EMAIL" ]; then
+                if [ -z "$FROM" ]; then FROM=$EMAIL; fi
             fi
         done
     done
@@ -85,6 +87,7 @@ done
 # etc. (*-by) will be added to CC.
 if [ $AUTO -eq 1 ]; then
     harvest_recipients TO "^[Tt][Oo]: *"
+    harvest_recipients FROM "^[Ff][rR][oO][mM]: *"
     harvest_recipients CC "^[Cc][Cc]: *"
     harvest_recipients CC "^.*-[Bb][Yy]: *"
 fi
@@ -112,20 +115,14 @@ read cont
 if [ "$cont" == "y" ] || [ "$cont" == "Y" ]; then
     ERROR=0
     for PATCH in $PDIR/*patch; do
-        # Insert To and CC headers via formail to keep them separate and
-        # appending them to the sendmail command as -- $TO $CC has proven
-        # to be an exercise in futility.
-        # 
-        # Use tail to remove the email envelope from git or formail as
-        # msmtp (sendmail) would choke on them.
-        cat $PATCH | formail -I "To: $TO" -I "CC: $CC" | tail -n +2 | sendmail -t
+        # Insert To and CC headers
+	git send-email --to="$TO" --cc="$CC" --from="$FROM" --confirm=auto $PATCH
         if [ $? -eq 1 ]; then
             ERROR=1
         fi
     done
     if [ $ERROR -eq 1 ]; then
-        echo "ERROR: sendmail failed to send one or more messages. Check your"
-        echo "       sendmail log for details."
+        echo "ERROR: git send-mail failed to send one or more messages."
     fi
 else
     echo "Send aborted."
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-12-22  0:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21  9:39 [PATCH] scripts/send-pull-request: Use git send-mail instead of sendmail Khem Raj
2010-12-21 21:19 ` Darren Hart
2010-12-21 21:32   ` Khem Raj
2010-12-21 21:37     ` Bruce Ashfield
2010-12-21 22:22       ` Khem Raj
2010-12-21 22:23         ` Darren Hart
2010-12-21 22:16     ` Darren Hart
2010-12-22  0:28 ` Darren Hart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.