summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO19
-rwxr-xr-xgit-bz18
2 files changed, 12 insertions, 25 deletions
diff --git a/TODO b/TODO
index 575cc7c..010c89c 100644
--- a/TODO
+++ b/TODO
@@ -6,25 +6,6 @@ any intention of working on it myself.
- Owen
-Reconsider initial description for 'git bz file'
-
- Right now, if you have only a single patch, the initial description is the body
- of the bug, and the attachment is done without any other comment. (But
- still adds a comment to the bug because every attachment has a comment.)
-
- I often find I want to have a few sentences about why I'm making the
- change different than the body of the commit (or ask someone to look at the
- patch or something), so I've been adding extra text and a separator,
- which leaves it unclear what the stuff after the separator is.
-
- Better way to handle it:
-
- - Start off the initial description empty in the editor
- - If the user fills it in, use that as the initial description
- and the body of the commit as the comment.
- - If the user leaves it empty use the body as the initial description
- as currently.
-
Use XML-RPC when available.
Maybe use python-bugzilla: http://fedorahosted.org/python-bugzilla/
diff --git a/git-bz b/git-bz
index 973f0a3..a3fb321 100755
--- a/git-bz
+++ b/git-bz
@@ -84,9 +84,8 @@
#
# Like 'attach', but files a new bug. Opens an editor for the user to
# enter the summary and description for the bug. If only a single commit
-# is named summary defaults to the subject of the commit, and the description
-# to the body of the bug. The product and component must be specified unless
-# you have configured defaults.
+# is named, the summary defaults to the subject of the commit. The product and
+# component must be specified unless you have configured defaults.
#
# Examples:
#
@@ -997,8 +996,6 @@ def do_file(*args):
template = StringIO()
if len(commits) == 1:
template.write(commits[0].subject)
- template.write("\n\n")
- template.write(get_body(commits[0]))
template.write("\n")
template.write("""
# Please enter the summary (first line) and description (other lines). Lines
@@ -1018,12 +1015,21 @@ def do_file(*args):
if summary == "":
die("Empty summary, aborting")
+ # If we have only one patch and no other description for the bug was
+ # specified, use the body of the commit as the the description for
+ # the bug rather than the descriptionfor the attachment
+ include_comments=True
+ if len(commits) == 1:
+ if description == "":
+ description = get_body(commits[0])
+ include_comments = False
+
bug = Bug.create(get_tracker(), product, component, summary, description)
if global_options.add_url:
add_url(bug, commits)
- attach_commits(bug, commits, include_comments=(len(commits) > 1))
+ attach_commits(bug, commits, include_comments=include_comments)
################################################################################