public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gcc-changelog: Make This reverts stricter.
@ 2022-03-28 10:30 Martin Liška
  2022-03-28 10:38 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Liška @ 2022-03-28 10:30 UTC (permalink / raw)
  To: gcc-patches

Make the parsing stricter so that we won't parse:

This reverts commit r12-1434-g046a3beb1673bf to fix PR target/104882.

Installed.
Martin

contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Make the parsing stricter.
---
  contrib/gcc-changelog/git_commit.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index 95dc49e5d48..7e29934b4ad 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -165,7 +165,7 @@ star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
  end_of_location_regex = re.compile(r'[\[<(:]')
  item_empty_regex = re.compile(r'\t(\* \S+ )?\(\S+\):\s*$')
  item_parenthesis_regex = re.compile(r'\t(\*|\(\S+\):)')
-revert_regex = re.compile(r'This reverts commit (?P<hash>\w+).$')
+revert_regex = re.compile(r'This reverts commit (?P<hash>[0-9a-f]+).$')
  cherry_pick_regex = re.compile(r'cherry picked from commit (?P<hash>\w+)')
  
  LINE_LIMIT = 100
@@ -317,7 +317,7 @@ class GitCommit:
  
          # Identify first if the commit is a Revert commit
          for line in self.info.lines:
-            m = revert_regex.match(line)
+            m = revert_regex.fullmatch(line)
              if m:
                  self.revert_commit = m.group('hash')
                  break
-- 
2.35.1


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

* Re: [PATCH] gcc-changelog: Make This reverts stricter.
  2022-03-28 10:30 [PATCH] gcc-changelog: Make This reverts stricter Martin Liška
@ 2022-03-28 10:38 ` Andreas Schwab
  2022-03-28 10:43   ` Martin Liška
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2022-03-28 10:38 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches

On Mär 28 2022, Martin Liška wrote:

> +revert_regex = re.compile(r'This reverts commit (?P<hash>[0-9a-f]+).$')

Is the trailing '.' supposed to match literally?

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] gcc-changelog: Make This reverts stricter.
  2022-03-28 10:38 ` Andreas Schwab
@ 2022-03-28 10:43   ` Martin Liška
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liška @ 2022-03-28 10:43 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gcc-patches

On 3/28/22 12:38, Andreas Schwab wrote:
> On Mär 28 2022, Martin Liška wrote:
> 
>> +revert_regex = re.compile(r'This reverts commit (?P<hash>[0-9a-f]+).$')
> 
> Is the trailing '.' supposed to match literally?
> 

Yes, pushed as a74ccc8cb02220ca45a1d0222ba5ba986abae570.

Thanks,
Martin

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

end of thread, other threads:[~2022-03-28 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 10:30 [PATCH] gcc-changelog: Make This reverts stricter Martin Liška
2022-03-28 10:38 ` Andreas Schwab
2022-03-28 10:43   ` Martin Liška

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).