public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] mklog: fix bugs of --append option
@ 2023-07-19  8:21 Lehua Ding
  2023-07-26  6:30 ` Lehua Ding
  2023-08-28 23:38 ` Jeff Law
  0 siblings, 2 replies; 6+ messages in thread
From: Lehua Ding @ 2023-07-19  8:21 UTC (permalink / raw)
  To: gcc-patches

Hi,

This little patch fix two bugs of mklog.py with --append option.
The first bug is that the regexp used is not accurate enough to
determine the top of diff area. The second bug is that if `---`
is not a true start, it needs to be added back to the patch file.

contrib/ChangeLog:

	* mklog.py: Fix regexp and add missed `---`

---
 contrib/mklog.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/mklog.py b/contrib/mklog.py
index 26230b9b4f2..bd81c5ba92c 100755
--- a/contrib/mklog.py
+++ b/contrib/mklog.py
@@ -385,12 +385,13 @@ if __name__ == '__main__':
                     if maybe_diff_log == 1 and line == "---\n":
                         maybe_diff_log = 2
                     elif maybe_diff_log == 2 and \
-                         re.match("\s[^\s]+\s+\|\s\d+\s[+\-]+\n", line):
+                         re.match("\s[^\s]+\s+\|\s+\d+\s[\+\-]+\n", line):
                         lines += [output, "---\n", line]
                         maybe_diff_log = 3
                     else:
                         # the possible start is not the true start.
                         if maybe_diff_log == 2:
+                            lines.append("---\n")
                             maybe_diff_log = 1
                         lines.append(line)
             with open(args.input, "w") as f:
-- 
2.36.1


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

end of thread, other threads:[~2023-08-29  1:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19  8:21 [PATCH] mklog: fix bugs of --append option Lehua Ding
2023-07-26  6:30 ` Lehua Ding
2023-08-16  5:10   ` Lehua Ding
2023-08-22  3:09   ` PING^^^^ " Lehua Ding
2023-08-28 23:38 ` Jeff Law
2023-08-29  1:43   ` Lehua Ding

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).