Skip to contentSkip to conversation

patman: make run results better visible

PATCH New Vadim Bendebury 3 participants 8 messages Sep 3, 2014 – Sep 10, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patman: make run results better visible

For an occasional user of patman some failures are not obvious: for instance when checkpatch reports warnings, the dry run still reports that the email would be sent. If it is not dry run, the warnings are shown on the screen, but it is not clear that the email was not sent.

Add some code to report failure to send email explicitly.

Tested by running the script on a patch with style violations, observed error messages in the script output.

---

 tools/patman/patman.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
tools/patman/patman.py +7 -1
index c60aa5a..0163ccd 100755
@@ -154,13 +154,19 @@ else:
 
     # Email the patches out (giving the user time to check / cancel)
     cmd = ''
-    if ok or options.ignore_errors:
+    its_a_go = ok or options.ignore_errors
+    if its_a_go:
         cmd = gitutil.EmailPatches(series, cover_fname, args,
                 options.dry_run, not options.ignore_bad_tags, cc_file,
                 in_reply_to=options.in_reply_to)
+    else:
+        print col.Color(col.RED,
+                        "Not sending emails due to checkpatch errors/warnings")
 
     # For a dry run, just show our actions as a sanity check
     if options.dry_run:
         series.ShowActions(args, cmd, options.process_tags)
+        if not its_a_go:
+            print col.Color(col.RED, "Email would not be sent")
 
     os.remove(cc_file)
Signature · 1 line
2.1.0.rc2.206.gedb03e5
#1 lore raw

PATCH 1/1 patman: make run results better visible

Vadim,

Quoted 23 lines · Vadim Bendebury

For an occasional user of patman some failures are not obvious: for instance when checkpatch reports warnings, the dry run still reports that the email would be sent. If it is not dry run, the warnings are shown on the screen, but it is not clear that the email was not sent.

Add some code to report failure to send email explicitly.

Tested by running the script on a patch with style violations, observed error messages in the script output.

---

 tools/patman/patman.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
tools/patman/patman.py +0 -0
index c60aa5a..0163ccd 100755
@@ -154,13 +154,19 @@ else:
 
     # Email the patches out (giving the user time to check / cancel)

tools/patman/patman.py else: · line 164

Quoted 10 lines
tools/patman/patman.py +5 -1
     cmd = ''
-    if ok or options.ignore_errors:
+    its_a_go = ok or options.ignore_errors
+    if its_a_go:
         cmd = gitutil.EmailPatches(series, cover_fname, args,
                 options.dry_run, not options.ignore_bad_tags, cc_file,
                 in_reply_to=options.in_reply_to)
+    else:
+        print col.Color(col.RED,
+                        "Not sending emails due to checkpatch errors/warnings")

Technically it could be due to other problems, too (like errors applying).

tools/patman/patman.py else: · line 172

Quoted 7 lines
tools/patman/patman.py +2 -0
     # For a dry run, just show our actions as a sanity check
     if options.dry_run:
         series.ShowActions(args, cmd, options.process_tags)
+        if not its_a_go:
+            print col.Color(col.RED, "Email would not be sent")
 
     os.remove(cc_file)

Looks good to me, other than that.

-Doug

#2 lore raw

PATCH 1/1 patman: make run results better visible

Quoted 25 lines · Doug Anderson

Vadim,

Quoted 22 lines · Vadim Bendebury

For an occasional user of patman some failures are not obvious: for instance when checkpatch reports warnings, the dry run still reports that the email would be sent. If it is not dry run, the warnings are shown on the screen, but it is not clear that the email was not sent.

Add some code to report failure to send email explicitly.

Tested by running the script on a patch with style violations, observed error messages in the script output.

---

 tools/patman/patman.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
tools/patman/patman.py +0 -0
index c60aa5a..0163ccd 100755
@@ -154,13 +154,19 @@ else:
 
Quoted 13 lines

tools/patman/patman.py else: · line 164

Quoted 11 lines
tools/patman/patman.py +5 -1
     # Email the patches out (giving the user time to check / cancel)
     cmd = ''
-    if ok or options.ignore_errors:
+    its_a_go = ok or options.ignore_errors
+    if its_a_go:
         cmd = gitutil.EmailPatches(series, cover_fname, args,
                 options.dry_run, not options.ignore_bad_tags, cc_file,
                 in_reply_to=options.in_reply_to)
+    else:
+        print col.Color(col.RED,
+                        "Not sending emails due to checkpatch errors/warnings")

Technically it could be due to other problems, too (like errors applying).

good point, what wording would you suggest?

--vb

Quoted 13 lines

tools/patman/patman.py else: · line 172

Quoted 9 lines
tools/patman/patman.py +2 -0
     # For a dry run, just show our actions as a sanity check
     if options.dry_run:
         series.ShowActions(args, cmd, options.process_tags)
+        if not its_a_go:
+            print col.Color(col.RED, "Email would not be sent")
 
     os.remove(cc_file)

Looks good to me, other than that.

-Doug

#3 lore raw

PATCH 1/1 patman: make run results better visible

Vadim,

Quoted 40 lines · Vadim Bendebury
Quoted 25 lines · Doug Anderson

Vadim,

Quoted 22 lines · Vadim Bendebury

For an occasional user of patman some failures are not obvious: for instance when checkpatch reports warnings, the dry run still reports that the email would be sent. If it is not dry run, the warnings are shown on the screen, but it is not clear that the email was not sent.

Add some code to report failure to send email explicitly.

Tested by running the script on a patch with style violations, observed error messages in the script output.

---

 tools/patman/patman.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
tools/patman/patman.py +0 -0
index c60aa5a..0163ccd 100755
@@ -154,13 +154,19 @@ else:
 
Quoted 13 lines

tools/patman/patman.py else: · line 164

Quoted 11 lines
tools/patman/patman.py +5 -1
     # Email the patches out (giving the user time to check / cancel)
     cmd = ''
-    if ok or options.ignore_errors:
+    its_a_go = ok or options.ignore_errors
+    if its_a_go:
         cmd = gitutil.EmailPatches(series, cover_fname, args,
                 options.dry_run, not options.ignore_bad_tags, cc_file,
                 in_reply_to=options.in_reply_to)
+    else:
+        print col.Color(col.RED,
+                        "Not sending emails due to checkpatch errors/warnings")

Technically it could be due to other problems, too (like errors applying).

Quoted 1 line

good point, what wording would you suggest?

You don't think that just removing the word "checkpatch" is enough.

#4 lore raw

PATCH v2 1/1 patman: make run results better visible

In reply to Vadim Bendebury

For an occasional user of patman some failures are not obvious: for instance when checkpatch reports warnings, the dry run still reports that the email would be sent. If it is not dry run, the warnings are shown on the screen, but it is not clear that the email was not sent.

Add some code to report failure to send email explicitly.

Tested by running the script on a patch with style violations, observed error messages in the script output.

---

Changes in v2:
- modified the error message for accuracy

 tools/patman/patman.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tools/patman/patman.py +6 -1
index c60aa5a..86e8e63 100755
@@ -154,13 +154,18 @@ else:
 
     # Email the patches out (giving the user time to check / cancel)
     cmd = ''
-    if ok or options.ignore_errors:
+    its_a_go = ok or options.ignore_errors
+    if its_a_go:
         cmd = gitutil.EmailPatches(series, cover_fname, args,
                 options.dry_run, not options.ignore_bad_tags, cc_file,
                 in_reply_to=options.in_reply_to)
+    else:
+        print col.Color(col.RED, "Not sending emails due to errors/warnings")
 
     # For a dry run, just show our actions as a sanity check
     if options.dry_run:
         series.ShowActions(args, cmd, options.process_tags)
+        if not its_a_go:
+            print col.Color(col.RED, "Email would not be sent")
 
     os.remove(cc_file)
Signature · 1 line
2.1.0.rc2.206.gedb03e5
#5 lore raw

PATCH v2 1/1 patman: make run results better visible

Vadim,

Quoted 10 lines · Vadim Bendebury

For an occasional user of patman some failures are not obvious: for instance when checkpatch reports warnings, the dry run still reports that the email would be sent. If it is not dry run, the warnings are shown on the screen, but it is not clear that the email was not sent.

Add some code to report failure to send email explicitly.

Tested by running the script on a patch with style violations, observed error messages in the script output.

Quoted 8 lines

---

Changes in v2:
- modified the error message for accuracy

 tools/patman/patman.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
#6 lore raw

PATCH v2 1/1 patman: make run results better visible

Quoted 17 lines · Doug Anderson

Vadim,

Quoted 13 lines · Vadim Bendebury

For an occasional user of patman some failures are not obvious: for instance when checkpatch reports warnings, the dry run still reports that the email would be sent. If it is not dry run, the warnings are shown on the screen, but it is not clear that the email was not sent.

Add some code to report failure to send email explicitly.

Tested by running the script on a patch with style violations, observed error messages in the script output.

---

Quoted 8 lines
Quoted 5 lines

Changes in v2:
- modified the error message for accuracy

 tools/patman/patman.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
#7 lore raw

PATCH v2 1/1 patman: make run results better visible

Applied to u-boot-x86/buildman, thanks!