From 7e301a7348d0b3006ffa7b2309aa6f40cc29a292 Mon Sep 17 00:00:00 2001 Message-Id: <7e301a7348d0b3006ffa7b2309aa6f40cc29a292.1715155564.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sun, 7 Oct 2007 13:34:18 +0200 Subject: [PATCH] Don't split long and short description in "stg edit" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Organization: Straylight/Edgeware From: Karl Hasselström "stg edit" used to present the patch information like this: Short description From: ... Date: ... Long description If the project follows the git convention with a single-line short description and follwed by a blank line and the rest of the description, this merely looks a little odd. However, for projects that don't follow that convention, presenting the first line separately is actively inconvenient; for example, it breaks emacs's fill-paragraph command. Signed-off-by: Karl Hasselström --- stgit/commands/edit.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/stgit/commands/edit.py b/stgit/commands/edit.py index e968e25..223c628 100644 --- a/stgit/commands/edit.py +++ b/stgit/commands/edit.py @@ -36,12 +36,10 @@ diff. The editor is invoked with the following contents: - Patch short description - From: A U Thor Date: creation date - Patch long description + Patch description If --diff was specified, the diff appears at the bottom, after a separator: @@ -135,22 +133,15 @@ def __edit_update_patch(pname, options): # generate the file to be edited descr = patch.get_description().strip() - descr_lines = descr.split('\n') authdate = patch.get_authdate() - short_descr = descr_lines[0].rstrip() - long_descr = reduce(lambda x, y: x + '\n' + y, - descr_lines[1:], '').strip() - - tmpl = '%(shortdescr)s\n\n' \ - 'From: %(authname)s <%(authemail)s>\n' + tmpl = 'From: %(authname)s <%(authemail)s>\n' if authdate: tmpl += 'Date: %(authdate)s\n' - tmpl += '\n%(longdescr)s\n' + tmpl += '\n%(descr)s\n' tmpl_dict = { - 'shortdescr': short_descr, - 'longdescr': long_descr, + 'descr': descr, 'authname': patch.get_authname(), 'authemail': patch.get_authemail(), 'authdate': patch.get_authdate() -- [mdw]