aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-11-21 13:03:09 +0100
committerThierry Reding <treding@nvidia.com>2014-11-21 13:03:09 +0100
commit42a6d4ff7d5ce47cfc719d4be14bc9821bc39506 (patch)
tree040c31dcf869bef3a6aecaed59dd0653d9a32ef4
parentb952b087cb65cf6fa271d90fa5bf487b3b029b01 (diff)
downloadmaint-scripts-42a6d4ff7d5ce47cfc719d4be14bc9821bc39506.tar.gz
Add a script to generate pull requests
The pull requests are generated for the release tags derived from the set of branches. The requests are only templates of course and may need manual tweaking occasionally. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rwxr-xr-xrequest-pull-linux-tegra.sh78
1 files changed, 78 insertions, 0 deletions
diff --git a/request-pull-linux-tegra.sh b/request-pull-linux-tegra.sh
new file mode 100755
index 0000000..0022e8a
--- /dev/null
+++ b/request-pull-linux-tegra.sh
@@ -0,0 +1,78 @@
+#!/bin/bash
+
+set -e
+set -x
+
+. "${0%/*}/tegra-branches.sh.dot"
+. "${0%/*}/lib.sh"
+
+git_tag_get_subject()
+{
+ local blank=no
+
+ git show $1 | while read line; do
+ if test "x$blank" = "xyes"; then
+ echo $line
+ break
+ fi
+
+ if test -z "$line"; then
+ blank=yes
+ fi
+ done
+}
+
+repository=git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git
+remote=$(get_remote)
+
+to="arm@kernel.org"
+cc="Stephen Warren <swarren@wwwdotorg.org>"
+cc="$cc, Thierry Reding <thierry.reding@gmail.com>"
+cc="$cc, Alexandre Courbot <gnurou@gmail.com>"
+cc="$cc, linux-tegra@vger.kernel.org"
+cc="$cc, linux-arm-kernel@lists.infradead.org"
+
+index=1
+count=0
+
+for branch in ${branches}; do
+ count=$[count + 1]
+done
+
+for branch in ${branches}; do
+ tag=tegra-${branch/\//-}
+ release=${branch%%/*}
+
+ if ! test -d "pull-request/$release"; then
+ mkdir -p "pull-request/$release"
+ fi
+
+ message=$(printf "pull-request/$release/%04u-$tag" $index)
+ name=$(git config --get user.name)
+ email=$(git config --get user.email)
+ date=$(date -R)
+ subject=$(git_tag_get_subject $tag)
+
+ if ! git config --get sendemail.from > /dev/null 2>&1; then
+ identity=$(git config --get sendemail.identity)
+ from=$(git config --get sendemail.$identity.from)
+ else
+ from=$(git config --get sendemail.from)
+ fi
+
+ exec 3> "$message"
+
+ echo "From $email $date" >&3
+ echo "From: $from" >&3
+ echo "To: $to" >&3
+ echo "Cc: $cc" >&3
+ printf "Subject: [GIT PULL %01u/%01u] $subject\n" $index $count >&3
+ echo "" >&3
+ echo "Hi ARM SoC maintainers," >&3
+ echo "" >&3
+ git request-pull $merge_base $repository $tag >&3
+
+ exec 3>&-
+
+ index=$[index + 1]
+done