diff mbox series

[ovs-dev,2/2] checkpatch: Overwrite patch file to include provisional subject.

Message ID 20230804205834.2522-2-csomani@redhat.com
State Changes Requested
Headers show
Series [ovs-dev,1/2] checkpatch: Enable subject checking on git-based patches. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Chandan Somani Aug. 4, 2023, 8:58 p.m. UTC
If a subject is missing, then a command like
utilities/checkpatch.py -S file.patch will write in the new subject
to file.patch itself.

Signed-off-by: Chandan Somani <csomani@redhat.com>
---
 utilities/checkpatch.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Simon Horman Aug. 7, 2023, 12:28 p.m. UTC | #1
On Fri, Aug 04, 2023 at 04:58:34PM -0400, Chandan Somani wrote:
> If a subject is missing, then a command like
> utilities/checkpatch.py -S file.patch will write in the new subject
> to file.patch itself.
> 
> Signed-off-by: Chandan Somani <csomani@redhat.com>

Hi Chandan,

I'm unclear on the motivation for this change.
Perhaps it would be useful to make that clearer in the patch description.
diff mbox series

Patch

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index fd44bacf1..dcdd65a63 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -1036,8 +1036,11 @@  def ovs_checkpatch_file(filename):
             else:
                 mail.add_header('Subject', sys.argv[-1])
 
+            with open(filename, 'w') as new_email:
+                new_email.write(mail.as_string())
+
             print("Subject missing! Your provisional subject is",
-                  mail['Subject'])
+                  sys.argv[-1])
 
         if check_spelling(mail['Subject'], False):
             print("Subject: %s" % mail['Subject'])