Commit Graph

21 Commits

Author SHA1 Message Date
Martin Jansa 52b1b6c98b send-pull-request: add extra CC argument
* useful e.g. when sending pull-request to release branch with extra CC
  for release maintainer

(From OE-Core rev: 52bc47756eb8a81ea07ef4bc06345ef335b30ceb)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 09:37:22 +00:00
Darren Hart 0db5532abf send-pull-request: Make -a really imply -c
The switch statement does not fall through as the comment suggests.
This results in -a not implying -c as was intended.

Add the two lines from -c to -a to achieve the intended behavior.

(From OE-Core rev: 319d2cc8e60450106b665ee4172e2e6dc90e14b5)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-02 15:28:38 +01:00
Otavio Salvador e38c283c01 scripts/send-pull-request: fix typo
s/No cover letter will be send./No cover letter will be sent./

(From OE-Core rev: a82e5abf399f3ced7dcb4d5c543fdea084ef6c63)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-12 21:50:20 +00:00
Otavio Salvador 8277ee93e1 scripts/send-pull-request: allow sending of patches without a cover letter
(From OE-Core rev: 326ef69d1296cd35a86d1eaee0741e6fc956af52)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-09 17:46:33 +00:00
Darren Hart ed5e3f11e2 send-pull-request: default to --supress-cc=all
Unless the user specifies -c, don't pull in any email addresses from the
patches in the series. This avoids having to remove the email addresses from
patches being pulled in from upstream. If you want the email addresses on the
patch to be added, continue to use the -c option as before.

(From OE-Core rev: aaa85bd838f1c1518f8e65c36e265e6b9e141406)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-19 17:34:18 +01:00
Dexuan Cui 7866ae0400 send-pull-request: fix a small typo that fails the script
(From OE-Core rev: 8a1266d49b9c23bfe3fb454f34524869ac9725b2)

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-02 14:55:56 +01:00
Otavio Salvador 7fd97dd14d send-pull-request: drop sendemail checks
git send-email has the correct check on it. Basically the From is
taken from the git 'user' and 'email' config values and in case
'sendemail.smtpserver' is not provided it defaults to use local
sendmail command.

(From OE-Core rev: b75cf390d75957f5b5718892942f76fc4295270f)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-25 15:50:53 +01:00
Darren Hart 2bc011d4b8 *pull-request: add copyright, license, and descriptions
(From OE-Core rev: 66b5a6bed6e55f2c285e2c3644302a6f242db32b)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:40 +01:00
Darren Hart 943951bb4d send-pull-request: streamline git-send-email usage
The script was sending one patch at a time, which defeats the internal
confirmation mechanism of git-send-email (which would otherwise allow
the user to send all patches or abort immediately).

Rework the sending logic to use no more than two commands. Use two
commands when the cover letter is to be sent to all recipients with
the -a argument. Otherwise, send all patches via the same command.

The script duplicates git's send confirmation, eliminate that.

Reported-by: Khem Raj <raj.khem@gmail.com>
(From OE-Core rev: 71286b32b58d4d1318b0a0a4b09ea65604d0e6fc)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Joshua Lock <josh@linux.intel.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Joshua Lock <josh@linux.intel.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:40 +01:00
Darren Hart a13fe8e454 send-pull-request: verify git sendemail config
Perform a quick sanity check to be able to direct users to configure
git.sendemail if they haven't yet.

(From OE-Core rev: 95185de6f149a495201701d260921339e3dfaebd)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:39 +01:00
Darren Hart 2b56f7b8c6 send-pull-request: don't send all patches to everyone even with -a
Rather than sending every patch to every recipient of the entire series when
-a is used, only send the cover letter to everyone and use git's
--signed-off-by-cc feature to generate an auto cc list for the individual
patches.

Add a -c option to use --signed-off-by-cc to auto cc recipeients at the
individual patch level. This is implied by -a.

Using git to harvest the Cc list means only collecting Signed-off-by and Cc
lines, rather than the more generic *-by lines previously. This is a fair
trade-off for significantly reduced complexity. If users want to add Acked-by
and Tested-by lines and want to use the -a feature, they should include those
recipients as Cc lines as well.

Now that we rely on git for auto-cc for the individual patches,
make sure the user is prompted before sending each patch by forcing
--confirm=always.

(From OE-Core rev: 90ef7136087f1a16da3c8fc2decbed27a5debcd8)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Koen Kooi <koen@dominion.thruhere.net>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:39 +01:00
Darren Hart ad6335ac7b send-pull-request: fix greedy auto-cc regex
A greedy regular expression caused emails to be harvested from patches
that were quoted in the commit message. Ensure only tags that start at the
beginning of the line are considered for harvesting.

NOTE: users are still responsible for verifying the recipients list and to
      ensure they do not spam people!

(From OE-Core rev: e155cdedb0ac7ce8e0d6cb0ed5f22e9367f5e343)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Saul Wold <sgw@linux.intel.com>
Cc: Bruce Ashfield <bruce.ashfield@windriver.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:38 +01:00
Darren Hart 58f901bf91 send-pull-request: remove local mta support
There is no real value in supporting sendmail directly when git
can be configured to use it. The script used to generate the
pull request mails relies heavily on git, so doing so here does
not impose any additional dependencies and it greatly reduces the
complexity of this script.

(From OE-Core rev: 9674aa9a5bb497ab52aaa0ba5c97a87388163120)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:38 +01:00
Darren Hart b158757ef9 send-pull-request: whitespace cleanup
Indent with tabs, not spaces, for consistency with other bash scripts.

(From OE-Core rev: 187217ec380e89d81a53d9fd5f007d8f95356029)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:38 +01:00
Khem Raj 9a1ee6de17 send-pull-request: Fetch TO email address from git config if specified
Usually people using git send-email has git config sendmail.to
configured to the usual mailing list or person so we harness that
here.

(From OE-Core rev: dae83a48f86fd5907cc999e912f476c89debd0bb)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-16 13:54:17 +00:00
Darren Hart 4e23e8f9d0 send-pull-request: ensure a proper FROM header is included
Commit 94629f2521 removes the FROM header when
sending via sendmail to avoid sending mail as the original change committer (as
opposed to the local user). This resulted in mail going out without any FROM
header, which some mailing lists correct by adding the *bounce address as the
FROM.

Correct this by reading FROM from the environment, from a new -f argument, or
from the git user.name and user.email config settings, in that order of
preference. Also display the FROM that will be used prior to the send
confirmation.

This has no effect if the -g (send via git) argument is specified, other than
printing the git sendemail.from config setting.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Reported-by: Saul Wold <saul.wold@intel.com>
2011-01-26 09:49:07 -08:00
Darren Hart 94629f2521 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>
2011-01-24 14:09:13 -08:00
Scott Garman 75748b6f09 send-pull-request: unset $TO and $CC from environment
Darren Hart and I discovered that when $CC is set (which
our meta-toolchain environment script sets up), the value
leaks into the use of this script. Unsetting $TO as well
just to be thorough.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
2011-01-24 14:09:13 -08:00
Darren Hart 585c506cd8 send-pull-request: allow users to select git-send-email or sendmail
Some users find it easier to use their git sendmail setup over a local
MTA to deliver mail with the send-pull-request script. If you would
like to do this, please read the git-send-email man page and set
the relevant entries in your git config. In particular, be sure to
set sendemail.from to avoid being asked each time.

Reported-by: Khem Raj <raj.khem@gmail.com>
CC: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2010-12-23 14:20:50 +00:00
Darren Hart 703148fde6 send-pull-request: Use current date in mail headers
Some users experience problems viewing the pull requests as a sequential
mail series due to the script using the git commit date for the patches
and today's date for the cover letter.

Address this by renaming the email Date: header to Old-Date: and adding
a new Date: header with a current timestamp.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Reported-by: Gary Thomas <gary@mlbassoc.com>
Cc: Josh Lock <josh@linux.intel.com>
2010-12-21 09:29:12 +00:00
Darren Hart 2e0ab8c18f git-pull: add send-pull-request script
send-pull-request facilitates sending pull requests generated by
create-pull-request. The primary role of this script is to harvest email
addresses from the patches and send them out. A working installation of sendmail
(exim, postfix, msmtp, etc.) is required to use this script.

You can explicitly specify To addresses with the -t option. As this can be
tedious, the -a option will scan all the patches for To, CC, and *-by lines and
the collected addresses to the To and CC headers for each patch.

This script uses an identical recipients list for every patch, including the
cover letter. This is by design. Existing tools will auto-generate the CC header
for individual patches, but since they don't apply it to the other patches, the
recipients can lack the necessary context to provide a meaningful review. This
is especially true of the cover letter.

The pull directory generated by the create-pull-request script is specified
using the -p option.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Nitin A Kamble <nitin.a.kamble@intel.com>
CC: Richard Purdie <rpurdie@linux.intel.com>
CC: Saul Wold <saul.wold@intel.com>
CC: Bruce Ashfield <bruce.ashfield@windriver.com>
2010-11-10 21:22:27 +08:00