aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-05-20 09:57:05 +0200
committerMartin Liska <mliska@suse.cz>2020-05-20 09:57:05 +0200
commit713890935db33b1e24abfae6a94bacc494f6412e (patch)
tree87742bf8f2c5d62e0e025635bced1a7651f1c972 /contrib
parent4a88caf21a0a85129f6c985ca13ba3eb54ff5366 (diff)
downloadgcc-713890935db33b1e24abfae6a94bacc494f6412e.zip
gcc-713890935db33b1e24abfae6a94bacc494f6412e.tar.gz
gcc-713890935db33b1e24abfae6a94bacc494f6412e.tar.bz2
Add gcc-backport and support git cherry pick.
* gcc-changelog/git_commit.py: Support cherry pick prefix. * gcc-changelog/test_email.py: Test it. * gcc-changelog/test_patches.txt: Add new patch. * gcc-git-customization.sh: Add gcc-backport.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog8
-rwxr-xr-xcontrib/gcc-changelog/git_commit.py3
-rwxr-xr-xcontrib/gcc-changelog/test_email.py4
-rw-r--r--contrib/gcc-changelog/test_patches.txt29
-rwxr-xr-xcontrib/gcc-git-customization.sh1
5 files changed, 45 insertions, 0 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index d9632fb..e3eaf05 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,11 @@
+2020-05-20 Martin Liska <mliska@suse.cz>
+
+ * gcc-changelog/git_commit.py: Support cherry pick
+ prefix.
+ * gcc-changelog/test_email.py: Test it.
+ * gcc-changelog/test_patches.txt: Add new patch.
+ * gcc-git-customization.sh: Add gcc-backport.
+
2020-05-19 Martin Liska <mliska@suse.cz>
* mklog.py: Use REST API for bug title downloading.
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index f6b9c5b..5cc8c4f 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -150,6 +150,7 @@ star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
LINE_LIMIT = 100
TAB_WIDTH = 8
CO_AUTHORED_BY_PREFIX = 'co-authored-by: '
+CHERRY_PICK_PREFIX = '(cherry picked from commit '
class Error:
@@ -349,6 +350,8 @@ class GitCommit:
author = self.format_git_author(name)
self.co_authors.append(author)
continue
+ elif line.startswith(CHERRY_PICK_PREFIX):
+ continue
# ChangeLog name will be deduced later
if not last_entry:
diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py
index 03abc76..5e99d32 100755
--- a/contrib/gcc-changelog/test_email.py
+++ b/contrib/gcc-changelog/test_email.py
@@ -258,3 +258,7 @@ class TestGccChangelog(unittest.TestCase):
email = self.from_patch_glob('0020-IPA-Avoid')
assert (email.errors[0].message
== 'first line should start with a tab, asterisk and space')
+
+ def test_cherry_pick_format(self):
+ email = self.from_patch_glob('0001-c-Alias.patch')
+ assert not email.errors
diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt
index 39e4753..ec667be 100644
--- a/contrib/gcc-changelog/test_patches.txt
+++ b/contrib/gcc-changelog/test_patches.txt
@@ -2382,3 +2382,32 @@ index 00000000000..66c87d48694
--
2.26.1
+=== 0001-c-Alias.patch ===
+From 3f1a149fc35cdba988464562e2fb824b10652d6b Mon Sep 17 00:00:00 2001
+From: Nathan Sidwell <nathan@acm.org>
+Date: Tue, 19 May 2020 13:29:19 -0700
+Subject: [PATCH] c++: Alias template instantiation template info
+
+I discovered that the alias instantiation machinery would setup
+template_info, and then sometime later overwrite that with equivalent
+info. This broke modules, because the template info, once set, is
+logically immutable. Let's just not do that.
+
+ * pt.c (lookup_template_class_1): Do not reinit template_info of an
+ alias here.
+
+(cherry picked from commit 74744bb1f2847b5b9ce3e97e0fec9c23bb0e499f)
+---
+ gcc/cp/pt.c | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
+index b8f03d18541..7230ac724ba 100644
+--- a/gcc/cp/pt.c
++++ b/gcc/cp/pt.c
+@@ -1 +1,2 @@
+
++
+--
+2.26.2
+
diff --git a/contrib/gcc-git-customization.sh b/contrib/gcc-git-customization.sh
index 91d378b..7a950ae 100755
--- a/contrib/gcc-git-customization.sh
+++ b/contrib/gcc-git-customization.sh
@@ -26,6 +26,7 @@ git config alias.gcc-descr \!"f() { if test \${1:-no} = --full; then c=\${2:-mas
git config alias.gcc-undescr \!"f() { o=\$(git config --get gcc-config.upstream); r=\$(echo \$1 | sed -n 's,^r\\([0-9]\\+\\)-[0-9]\\+\$,\\1,p'); n=\$(echo \$1 | sed -n 's,^r[0-9]\\+-\\([0-9]\\+\\)\$,\\1,p'); test -z \$r && echo Invalid id \$1 && exit 1; h=\$(git rev-parse --verify --quiet \${o:-origin}/releases/gcc-\$r); test -z \$h && h=\$(git rev-parse --verify --quiet \${o:-origin}/master); p=\$(git describe --all --match 'basepoints/gcc-'\$r \$h | sed -n 's,^\\(tags/\\)\\?basepoints/gcc-[0-9]\\+-\\([0-9]\\+\\)-g[0-9a-f]*\$,\\2,p;s,^\\(tags/\\)\\?basepoints/gcc-[0-9]\\+\$,0,p'); git rev-parse --verify \$h~\$(expr \$p - \$n); }; f"
git config alias.gcc-verify '!f() { "`git rev-parse --show-toplevel`/contrib/gcc-changelog/git_check_commit.py" $@; } ; f'
+git config alias.gcc-backport '!f() { rev=$1; git cherry-pick -x $@; } ; f'
git config alias.gcc-mklog '!f() { "`git rev-parse --show-toplevel`/contrib/mklog.py" $@; } ; f'