diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2008-12-03 23:01:29 -0500 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2008-12-03 23:15:06 -0500 |
commit | 05e0ff3ad3e39b30c366d4fdc11f90ea63daafd7 (patch) | |
tree | 6cd6e5b6fcc7f78c07c76b3214e6ca0405eeb44b | |
parent | 33af368350715559855c2828e64303a925ffa6a8 (diff) |
Allow a separate description for git bz file
Only use the commit body as the bug description when filing a new bug
if no other description is specified; if another description is
entered, use the commit body as the description for the attachment.
-rw-r--r-- | TODO | 19 | ||||
-rwxr-xr-x | git-bz | 18 |
2 files changed, 12 insertions, 25 deletions
@@ -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/ @@ -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) ################################################################################ |