Commit Graph

22 Commits

Author SHA1 Message Date
Bernhard Reutner-Fischer dab4662822 create-pull-request: Error message on missing -u
The script was erroring out without a hint on what failed.

(From OE-Core rev: 72266cfa3a12a19a94d9176ecca9d080658dbf2e)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-08 14:50:36 +00:00
Nitin A Kamble 8251685031 create-pull-request: detect trailing white space
Add logic in the create-pull-request to detect and warn about the
trailing white space inserted by patches.

(From OE-Core rev: 3e35310db3cd6d265092724a0e542b9616aca9c5)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-13 15:18:44 +00:00
Darren Hart 177171ccf1 create-pull-request: Assume remote branch from local branch
It is common to use the same remote branch name as the local branch
name. In this case, it would be nice not to have to specify the
remote branch name.

Make the -b argument optional and assume the remote branch is the same
name as the local branch. Print a NOTE to this effect so as not to
catch the user by surprise:

NOTE: Assuming remote branch 'notthere', use -b to override.

If the remote branch doesn't exist, a WARNING is displayed just as if
the user had used -b to specify a non-existent branch:

WARNING: Branch 'notthere' was not found on the contrib git tree.
         Please check your remote and branch parameter before sending.

(From OE-Core rev: 62570b7e3db44fbc3461f650abe6c4613940e068)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-10 13:31:58 +01:00
Anders Darander c8294d1e6d create-pull-request: increase likelihood of detecting a rename
Decrease the similarity percentage needed to recognize a delete/add-pair followed by an edit,
as a rename.
This make reviewing patches easier.

(From OE-Core rev: 3944f5e02d22b70b3bcd733a80f005dbd8e248a2)

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-17 15:14:58 +01:00
Mark Hatle d2a9470342 create-pull-request: Add URL documentation
If we can't find the URL, tell the user how to correct the issue.

(From OE-Core rev: e5edda2e84e19a90ca2b0a6d4c265e5d5f59d42a)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09 15:48:26 +01:00
Martin Jansa e8ded5e863 create-pull-request: allow '+' in git PROTO_RE, ie for 'git+ssh://'
(From OE-Core rev: fb556532d4320518b96808d773d9e42719293be4)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-01 18:34:36 +01:00
Darren Hart 567f171920 create-pull-request: generalize the repository URL parsing
The existing REMOTE_URL and REMOTE_REPO parsing made assumptions regarding
the git URL format used for the known repository types. In fact, both of
these ssh URL formats are valid for all the known repositories. Specifically:

  ssh://git@server/repository/path
  git@server:repository/path

Generalize the parsing to work with each of these for all push URLs matching
*@*. Tested with the following URLs:

  ssh://git@git.pokylinux.org/poky-contrib
  ssh://git@git.pokylinux.org/poky-contrib.git
  git@git.pokylinux.org:poky-contrib
  git@git.pokylinux.org:poky-contrib.git

(From OE-Core rev: 861c288e353e917374de938c4e5e927e116cd56c)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-25 15:50:54 +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 8402e2281d create-pull-request: add untested oe repository support
(From OE-Core rev: c7f76dfb37022805458a7aeab8a51e44437f9abd)

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
Otavio Salvador b131ca1834 create-pull-request: add GitHub remote support
(From OE-Core rev: e504b149fe2f057e38c19642b3d71bf43be2d62a)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:39 +01:00
Otavio Salvador 5f9f2188b5 create-pull-request: do not check certificate
Some remotes can use HTTPS and we don't need to check the certificate
of the host so wget call is changed to avoid it.

(From OE-Core rev: 027667824ca78d4f118d1917a515a675d966985c)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:39 +01:00
Darren Hart dca0c48465 create-pull-request: provide an RFC mode via -c argument
Currently it is difficult to know if a pull request is being sent for review
or just to be pulled.

Add a -c argument to add RFC to the subject prefix and a blurb requesting
review to the cover letter.

(From OE-Core rev: e4f66ec2a8af56fb4d0a85df46bfaa3bb1409d31)

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: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Saul Wold <sgw@linux.intel.com>
Cc: Paul Eggleton <paul.eggleton@intel.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:38 +01:00
Darren Hart 5ad2ebadfb create-pull-request: rewrite known private URLs to public URLs
Rather than requiring users to have public remotes and private remotes when
their development remotes are ssh based (and therefor unsuitable for a pull
request URL), rewrite the ones we know about from ssh://git@ to git://.

As the remote url vary from remote to remote, do the REMOTE_REPO regex per
remote.

With this infrastructure in place, future patches can augment the list of
known remotes for things like Git Hub, Gitorious, kernel.org, etc.

(From OE-Core rev: 3c34975414f1184a35ad8b6ca8a5303786f3475f)

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>
Acked-by: Tom Rini <tom_rini@mentor.com>
Cc: Tom Rini <tom_rini@mentor.com>
Cc: Martin Jansa <martin.jansa@gmail.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:37 +01:00
Darren Hart 65c2d1eb82 create-pull-request: use git request-pull and arbitrary remotes
Allow for arbitrary remotes via a new -u argument. Remove the hard coded
references to the pokylinux repositories. Create the WEB_URL from known
remotes. Future patches can add additional WEB_URL mappings for remotes
like Git Hub, Gitorious, and kernel.org.

Rather than duplicating the git request-pull command ourselves, just use
the existing one.

(From OE-Core rev: 847fa2542aad8233d31076d8eaf4ba3168a79eae)

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>
Acked-by: Tom Rini <tom_rini@mentor.com>
Cc: Tom Rini <tom_rini@mentor.com>
Cc: Martin Jansa <martin.jansa@gmail.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-19 23:40:37 +01:00
Darren Hart e39bb8cd12 create-pull-request: whitespace cleanup
Indent with tabs, not spaces, to be consistent with other bash scripts.

(From OE-Core rev: bf78a66f3adfc720ee84ff457143722f3752e8c5)

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:37 +01:00
Darren Hart 8a64780425 create-pull-request: alphabetize arguments
Some initial cleanup prior to a significant overhaul.

(From OE-Core rev: 926ca57b0eca7d94b933d2949d04a20ff176e57d)

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:37 +01:00
Martin Jansa 8b2e973d14 create-pull-request: switch URL from git.pokylinux.org/poky-contrib to git.openembedded.org/openembedded-core-contrib
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2011-05-19 23:40:21 +01:00
Darren Hart 1f0e2cf16a git-pull: add the new create-pull-request script
The previous create-pull-request only generated a cover letter. When used to
send to the list, it did not include the patches, which made it difficult
to perform peer review. A pull request without patches is typically only sent
by a maintainer. As we are not all maintainers, we need a means to easily
submit patches for review.

As we are accustomed to making pull requests, this script retains a
git-pull-style cover letter, while sending the relevant patches as responses
to the pull. This will provide the necessary context for peer review, and still
allow people to collapse threads and see no more mail than they were previously.

This version retains the relative_to, commit_id, and contrib_branch arguments
from the original, along with their default values. It adds several more,
resulting in a highly flexible tool.

The script creates a pull directory (pull-$$ by default, configurable via the -o
option) and populates it with a git-format-patch generated patch series and
cover letter. The cover letter is modified to include the git and http pull URLs
and branch name, as well as a basic signature from the author pulled from git's
user.name and user.email config. git-format-patch provides the shortlog and
diffstat of the series.

Breaking a bit from the original, this script maintains the [PATCH] subject
prefix in the cover letter (as opposed to [GIT PULL]. This is better suited to
the majority of developers (who are not maintainers). This prefix is
configurable with the -p option, allowing you to create an [RFC PATCH]
prefix, for example.

By default, the generated cover letter with contain "*** SUBJECT HERE ***" and
"*** BLURB HERE ***" tokens which you should replace with something
appropriate prior to sending the messages.

When developing multiple versions of a patch series, it can save time to
maintain a message.txt file, rather than having to retype the message body of
the cover letter every time. The -m option allows you to specify a message file
and replace the "*** BLURB HERE ***" token of the cover letter with the contents
of the message file.

Finally, the -s option will replace the "*** SUBJECT HERE ***" token in the cover
letter with the specified subject.

The generated patches are suitable for sending via sendmail.

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
Darren Hart 09ee361d42 git pull: remove the existing create_pull_request script
The patches to follow completely rewrite the existing create-pull-request.
Rather than have an initial diff of the two files (which are not at all
similar) remove the original, and then create the new one.

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
Nitin A Kamble b43fd541d3 scripts/create_pull_request fix a typo
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-10 16:30:32 -07:00
Nitin A Kamble 1d64687d13 update create_pull_request for distro/master
With this change the create_pull_request will be able to generate pull
requests to master as well as distro/master branch.

Some documentation is added in the Usage messange of the script.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-10 16:30:32 -07:00
Nitin A Kamble bad2fe6498 add a new scripts create-pull-request
This is the 1st version of create-pull-request script.
Using specified local commit-id or branch-name it
generates a short description of the changes;
and using poky-contrib branch-name it generates the
URL where these changes are already pushed
and are available for review and git-pull.

I prepared this script as per the input from Richard Purdie.

Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-05-17 13:47:40 -07:00