git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Angus Salkeld" <ahsalkeld@gmail.com>
To: catalin.marinas@gmail.com
Cc: git@vger.kernel.org
Subject: [PATCH] stg mail crashes when there is no patch description
Date: Fri, 29 Feb 2008 12:14:36 +1300	[thread overview]
Message-ID: <8daa1da0802281514wcaaafc0m436311f0046ba0c@mail.gmail.com> (raw)

stg mail crashes when there is no patch description

The error is:
File "/usr/lib/python2.4/site-packages/stgit/commands/mail.py", line
397, in __build_message
descr = p.get_description().strip()
AttributeError: 'NoneType' object has no attribute 'strip'

This patch tries to handle this a bit better by setting the description
to "<empty message>" and forcing the edit_patches option on.
---

 stgit/commands/mail.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index f12d694..63c4b39 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -393,7 +393,13 @@ def __build_message(tmpl, patch, patch_nr,
total_nr, msg_id, ref_id, options):
     """
     p = crt_series.get_patch(patch)

-    descr = p.get_description().strip()
+    if p.get_description():
+        descr = p.get_description().strip()
+    else:
+        # provide a place holder and force the edit message option on
+        descr = '<empty message>'
+        options.edit_patches = True
+
     descr_lines = descr.split('\n')

     short_descr = descr_lines[0].rstrip()

                 reply	other threads:[~2008-02-28 23:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8daa1da0802281514wcaaafc0m436311f0046ba0c@mail.gmail.com \
    --to=ahsalkeld@gmail.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).