git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [StGit PATCH 4/8] Don't split long and short description in "stg edit"
Date: Mon, 08 Oct 2007 01:17:35 +0200	[thread overview]
Message-ID: <20071007231735.12626.81744.stgit@yoghurt> (raw)
In-Reply-To: <20071007231446.12626.14259.stgit@yoghurt>

"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>

---

 stgit/commands/edit.py |   17 ++++-------------
 1 files 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 <author@example.com>
   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()

  parent reply	other threads:[~2007-10-07 23:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-07 23:17 [StGit PATCH 0/8] Miscellaneous fixes and improvements Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 1/8] Add --ack/--sign options to "stg new" Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 2/8] New test: "stg pop --keep" Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 3/8] Fix up the help text for "stg edit" Karl Hasselström
2007-10-07 23:17 ` Karl Hasselström [this message]
2007-10-07 23:40   ` [StGit PATCH 4/8] Don't split long and short description in " David Brown
2007-10-08  6:41     ` Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 5/8] Make a common superclass for all StGit exceptions Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 6/8] Simplify debug level error checking Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 7/8] Discard stderr output from git-rev-parse Karl Hasselström
2007-10-07 23:18 ` [StGit PATCH 8/8] Remove the --force flag to "stg rebase" and "stg pull" Karl Hasselström

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=20071007231735.12626.81744.stgit@yoghurt \
    --to=kha@treskal.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).