"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 <kha@treskal.com>
The editor is invoked with the following contents:
The editor is invoked with the following contents:
- Patch short description
-
From: A U Thor <author@example.com>
Date: creation date
From: A U Thor <author@example.com>
Date: creation date
If --diff was specified, the diff appears at the bottom, after a
separator:
If --diff was specified, the diff appears at the bottom, after a
separator:
# generate the file to be edited
descr = patch.get_description().strip()
# generate the file to be edited
descr = patch.get_description().strip()
- descr_lines = descr.split('\n')
authdate = patch.get_authdate()
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'
if authdate:
tmpl += 'Date: %(authdate)s\n'
- tmpl += '\n%(longdescr)s\n'
+ tmpl += '\n%(descr)s\n'
- 'shortdescr': short_descr,
- 'longdescr': long_descr,
'authname': patch.get_authname(),
'authemail': patch.get_authemail(),
'authdate': patch.get_authdate()
'authname': patch.get_authname(),
'authemail': patch.get_authemail(),
'authdate': patch.get_authdate()