{"thread":{"id":"1829","subject":"[patch 02/11] Make \"empty patch\" checking optional in \"series\" command.","startedAt":"2005-09-16T19:35:11Z","lastAt":"2005-09-17T08:17:17Z","messageCount":12,"participants":["Paolo 'Blaisorblade' Giarrusso","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":11},"messages":[{"id":"8710","messageId":"20050916193511.18681.24189.stgit@zion.home.lan","threadId":"1829","inReplyTo":null,"subject":"[patch 01/11] Fix typo: comitter->committer","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:11Z","receivedAt":"2005-09-16T19:35:11Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"Found casually in commit.__init__, while profiling stg series.\nAnd yes, I went checking that git has no typo.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/git.py |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/git.py b/stgit/git.py\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -56,7 +56,7 @@ class Commit:\n                 self.__parent = field[1]\n             if field[0] == 'author':\n                 self.__author = field[1]\n-            if field[0] == 'comitter':\n+            if field[0] == 'committer':\n                 self.__committer = field[1]\n         self.__log = ''.join(lines[i:])\n \n"},{"id":"8705","messageId":"20050916193513.18681.60765.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 02/11] Make \"empty patch\" checking optional in \"series\" command.","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:13Z","receivedAt":"2005-09-16T19:35:13Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"That's just too slow, and quilt doesn't do it, so user will live with it.\nDon't know if there's a reason to allow dropping the fanciness here\nentirely, but I think there's no user doing one-liner scripts with quilt\nseries. And anyway, for that you can do \"stg applied; stg unapplied\".\n\nActually, with this patch you must ask explicitly the checking.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/commands/series.py |   11 +++++++----\n 1 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/stgit/commands/series.py b/stgit/commands/series.py\n--- a/stgit/commands/series.py\n+++ b/stgit/commands/series.py\n@@ -31,7 +31,10 @@ Show all the patches in the series. The \n with a '+' and the unapplied ones with a '-'. The current patch is\n prefixed with a '>'. Empty patches are prefixed with a '0'.\"\"\"\n \n-options = []\n+options = [make_option('-e', '--empty',\n+                       help = 'check whether patches are empty '\n+                       '(much slower)',\n+                       action = 'store_true') ]\n \n \n def func(parser, options, args):\n@@ -43,19 +46,19 @@ def func(parser, options, args):\n     applied = crt_series.get_applied()\n     if len(applied) > 0:\n         for p in applied [0:-1]:\n-            if crt_series.empty_patch(p):\n+            if options.empty and crt_series.empty_patch(p):\n                 print '0', p\n             else:\n                 print '+', p\n         p = applied[-1]\n \n-        if crt_series.empty_patch(p):\n+        if options.empty and crt_series.empty_patch(p):\n             print '0>%s' % p\n         else:\n             print '> %s' % p\n \n     for p in crt_series.get_unapplied():\n-        if crt_series.empty_patch(p):\n+        if options.empty and crt_series.empty_patch(p):\n             print '0', p\n         else:\n             print '-', p\n"},{"id":"8707","messageId":"20050916193515.18681.83716.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 03/11] stg diff / files: don't update directory cache unless needed","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:15Z","receivedAt":"2005-09-16T19:35:15Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"Do git-update-cache only when diffing with the working tree, not otherwise.\nSpending something like 1min for a stg files is bad - yes, my laptop\nwas really busy and the Linux tree was probably cache-cold, but that's just\nnot needed.\n\nAlso, in diffstat we currently do it both by hand and by calling git.diff.\nAnd in files there's no need at all for that - even the comments says that\n\"files\" has only to do with committed changes.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/git.py |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/stgit/git.py b/stgit/git.py\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -376,11 +376,11 @@ def status(files = [], modified = False,\n def diff(files = [], rev1 = 'HEAD', rev2 = None, out_fd = None):\n     \"\"\"Show the diff between rev1 and rev2\n     \"\"\"\n-    os.system('git-update-cache --refresh > /dev/null')\n \n     if rev2:\n         diff_str = _output(['git-diff-tree', '-p', rev1, rev2] + files)\n     else:\n+        os.system('git-update-cache --refresh > /dev/null')\n         diff_str = _output(['git-diff-cache', '-p', rev1] + files)\n \n     if out_fd:\n@@ -392,7 +392,6 @@ def diffstat(files = [], rev1 = 'HEAD', \n     \"\"\"Return the diffstat between rev1 and rev2\n     \"\"\"\n \n-    os.system('git-update-cache --refresh > /dev/null')\n     p=popen2.Popen3('git-apply --stat')\n     diff(files, rev1, rev2, p.tochild)\n     p.tochild.close()\n@@ -404,7 +403,6 @@ def diffstat(files = [], rev1 = 'HEAD', \n def files(rev1, rev2):\n     \"\"\"Return the files modified between rev1 and rev2\n     \"\"\"\n-    os.system('git-update-cache --refresh > /dev/null')\n \n     str = ''\n     for line in _output_lines('git-diff-tree -r %s %s' % (rev1, rev2)):\n"},{"id":"8706","messageId":"20050916193516.18681.83723.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 04/11] Fix \"mail\" command when description contains \"From\" lines","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:16Z","receivedAt":"2005-09-16T19:35:16Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"For kernel patches, the \"From\" line from the email is often preserved in\nthe patch itself, and the one from the email is sometimes lost, so I add an\nexplicit one. And mail barfes on this.\nFix it up.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/commands/mail.py |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -122,7 +122,7 @@ def __parse_addresses(string):\n         elif re.match('(to|cc|bcc):\\s+', line, re.I):\n             to_addr_list += __addr_list(line)\n \n-    if len(from_addr_list) != 1:\n+    if len(from_addr_list) == 0:\n         raise CmdException, 'No \"From\" address'\n     if len(to_addr_list) == 0:\n         raise CmdException, 'No \"To/Cc/Bcc\" addresses'\n"},{"id":"8712","messageId":"20050916193517.18681.71959.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 05/11] Make \"stg files\" output match \"quilt files\" one","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:17Z","receivedAt":"2005-09-16T19:35:17Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"I'm used to doing vi $(quilt files), which is impossible with stgit.\nAdd an option (-b/--base) to request the normal behaviour, but make it\nnon-default as the current output is useful.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/commands/files.py |    5 +++++\n stgit/git.py            |   10 ++++++++++\n 2 files changed, 15 insertions(+), 0 deletions(-)\n\ndiff --git a/stgit/commands/files.py b/stgit/commands/files.py\n--- a/stgit/commands/files.py\n+++ b/stgit/commands/files.py\n@@ -35,6 +35,9 @@ command. Use the 'diff' or 'status' comm\n \n options = [make_option('-s', '--stat',\n                        help = 'show the diff stat',\n+                       action = 'store_true'),\n+           make_option('-b', '--bare',\n+                       help = 'bare file names (useful for scripting)',\n                        action = 'store_true')]\n \n \n@@ -53,5 +56,7 @@ def func(parser, options, args):\n \n     if options.stat:\n         print git.diffstat(rev1 = rev1, rev2 = rev2)\n+    elif options.bare:\n+        print git.barefiles(rev1, rev2)\n     else:\n         print git.files(rev1, rev2)\ndiff --git a/stgit/git.py b/stgit/git.py\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -410,6 +410,16 @@ def files(rev1, rev2):\n \n     return str.rstrip()\n \n+def barefiles(rev1, rev2):\n+    \"\"\"Return the files modified between rev1 and rev2, without status info\n+    \"\"\"\n+\n+    str = ''\n+    for line in _output_lines('git-diff-tree -r %s %s' % (rev1, rev2)):\n+        str += '%s\\n' % line.rstrip().split(' ',4)[-1].split('\\t',1)[-1]\n+\n+    return str.rstrip()\n+\n def checkout(files = [], tree_id = None, force = False):\n     \"\"\"Check out the given or all files\n     \"\"\"\n"},{"id":"8709","messageId":"20050916193518.18681.9261.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 06/11] Avoid allowing --undo if it doesn't change anything","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:19Z","receivedAt":"2005-09-16T19:35:19Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n\nAvoid top/bottom backup files identical to current ones. Simply remove\nthem.\n\nAlso, change restore_old_boundaries() to handle gracefully the new\nsituation rather than print an exception.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/commands/push.py |    6 ++++--\n stgit/stack.py         |   17 +++++++++++++----\n 2 files changed, 17 insertions(+), 6 deletions(-)\n\ndiff --git a/stgit/commands/push.py b/stgit/commands/push.py\n--- a/stgit/commands/push.py\n+++ b/stgit/commands/push.py\n@@ -66,8 +66,10 @@ def func(parser, options, args):\n         print 'Undoing the \"%s\" push...' % patch,\n         sys.stdout.flush()\n         resolved_all()\n-        crt_series.undo_push()\n-        print 'done'\n+        if crt_series.undo_push():\n+            print 'done'\n+        else:\n+            print 'done (patch unchanged)'\n         print_crt_patch()\n \n         return\ndiff --git a/stgit/stack.py b/stgit/stack.py\n--- a/stgit/stack.py\n+++ b/stgit/stack.py\n@@ -170,7 +170,11 @@ class Patch:\n \n     def set_bottom(self, string, backup = False):\n         if backup:\n-            self.__set_field('bottom.old', self.__get_field('bottom'))\n+            curr = self.__get_field('bottom')\n+            if curr != string:\n+                self.__set_field('bottom.old', curr)\n+            else:\n+                self.__set_field('bottom.old', None)\n         self.__set_field('bottom', string)\n \n     def get_top(self):\n@@ -178,7 +182,11 @@ class Patch:\n \n     def set_top(self, string, backup = False):\n         if backup:\n-            self.__set_field('top.old', self.__get_field('top'))\n+            curr = self.__get_field('top')\n+            if curr != string:\n+                self.__set_field('top.old', curr)\n+            else:\n+                self.__set_field('top.old', None)\n         self.__set_field('top', string)\n \n     def restore_old_boundaries(self):\n@@ -188,8 +196,9 @@ class Patch:\n         if top and bottom:\n             self.__set_field('bottom', bottom)\n             self.__set_field('top', top)\n+            return True\n         else:\n-            raise StackException, 'No patch undo information'\n+            return False\n \n     def get_description(self):\n         return self.__get_field('description', True)\n@@ -571,7 +580,7 @@ class Series:\n         patch = Patch(name, self.__patch_dir)\n         git.reset()\n         self.pop_patch(name)\n-        patch.restore_old_boundaries()\n+        return patch.restore_old_boundaries()\n \n     def pop_patch(self, name):\n         \"\"\"Pops the top patch from the stack\n"},{"id":"8711","messageId":"20050916193520.18681.36248.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 07/11] Implement fast-forward when only tree (but not commits) match","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:20Z","receivedAt":"2005-09-16T19:35:20Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n\nWhen the \"bottom\" commit and the HEAD don't match, but they refer to the\nsame tree (for instance after a refresh where only the description\nchanged), we can still fast-forward, by keeping the same top tree and\ncalling git-commit-tree (which only requires the tree object) with the new\nparent. I've altered git.commit to allow this.\n\nBtw, I've also avoided the use of .commitmsg and switched to piping the\ndescription.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/git.py   |   30 ++++++++++++++++--------------\n stgit/stack.py |   35 +++++++++++++++++++++++++++++++----\n 2 files changed, 47 insertions(+), 18 deletions(-)\n\ndiff --git a/stgit/git.py b/stgit/git.py\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -119,8 +119,12 @@ def _output(cmd):\n         raise GitException, '%s failed' % str(cmd)\n     return string\n \n-def _output_one_line(cmd):\n+def _output_one_line(cmd, file_desc = None):\n     p=popen2.Popen3(cmd)\n+    if file_desc != None:\n+        for line in file_desc:\n+            p.tochild.write(line)\n+        p.tochild.close()\n     string = p.fromchild.readline().strip()\n     if p.wait():\n         raise GitException, '%s failed' % str(cmd)\n@@ -286,7 +290,7 @@ def update_cache(files = [], force = Fal\n     return True\n \n def commit(message, files = [], parents = [], allowempty = False,\n-           cache_update = True,\n+           cache_update = True, tree_id = None,\n            author_name = None, author_email = None, author_date = None,\n            committer_name = None, committer_email = None):\n     \"\"\"Commit the current tree to repository\n@@ -298,15 +302,15 @@ def commit(message, files = [], parents \n             raise GitException, 'No changes to commit'\n \n     # get the commit message\n-    f = file('.commitmsg', 'w+')\n-    if message[-1:] == '\\n':\n-        f.write(message)\n-    else:\n-        print >> f, message\n-    f.close()\n+    if message[-1:] != '\\n':\n+        message += '\\n'\n \n+    must_switch = True\n     # write the index to repository\n-    tree_id = _output_one_line('git-write-tree')\n+    if tree_id == None:\n+        tree_id = _output_one_line('git-write-tree')\n+    else:\n+        must_switch = False\n \n     # the commit\n     cmd = ''\n@@ -326,11 +330,9 @@ def commit(message, files = [], parents \n     for p in parents:\n         cmd += ' -p %s' % p\n \n-    cmd += ' < .commitmsg'\n-\n-    commit_id = _output_one_line(cmd)\n-    __set_head(commit_id)\n-    os.remove('.commitmsg')\n+    commit_id = _output_one_line(cmd, message)\n+    if must_switch:\n+        __set_head(commit_id)\n \n     return commit_id\n \ndiff --git a/stgit/stack.py b/stgit/stack.py\n--- a/stgit/stack.py\n+++ b/stgit/stack.py\n@@ -495,13 +495,40 @@ class Series:\n             # top != bottom always since we have a commit for each patch\n             if head == bottom:\n                 # reset the backup information\n-                patch.set_bottom(bottom, backup = True)\n+                patch.set_bottom(head, backup = True)\n                 patch.set_top(top, backup = True)\n \n             else:\n-                top = head\n-                # stop the fast-forwarding, must do a real merge\n-                break\n+                head_tree = git.get_commit(head).get_tree()\n+                bottom_tree = git.get_commit(bottom).get_tree()\n+                if head_tree == bottom_tree:\n+                    # We must just reparent this patch and create a new commit\n+                    # for it\n+                    descr = patch.get_description()\n+                    author_name = patch.get_authname()\n+                    author_email = patch.get_authemail()\n+                    author_date = patch.get_authdate()\n+                    committer_name = patch.get_commname()\n+                    committer_email = patch.get_commemail()\n+\n+                    top_tree = git.get_commit(top).get_tree()\n+\n+                    top = git.commit(message = descr, parents = [head],\n+                                     cache_update = False,\n+                                     tree_id = top_tree,\n+                                     allowempty = True,\n+                                     author_name = author_name,\n+                                     author_email = author_email,\n+                                     author_date = author_date,\n+                                     committer_name = committer_name,\n+                                     committer_email = committer_email)\n+\n+                    patch.set_bottom(head, backup = True)\n+                    patch.set_top(top, backup = True)\n+                else:\n+                    top = head\n+                    # stop the fast-forwarding, must do a real merge\n+                    break\n \n             forwarded+=1\n             unapplied.remove(name)\n"},{"id":"8713","messageId":"20050916193521.18681.32747.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 08/11] Fix \"stg clean\" when stack is empty","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:21Z","receivedAt":"2005-09-16T19:35:21Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n\nIt crashes on accessing 1st element of an empty array.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/commands/clean.py |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/commands/clean.py b/stgit/commands/clean.py\n--- a/stgit/commands/clean.py\n+++ b/stgit/commands/clean.py\n@@ -65,7 +65,8 @@ def func(parser, options, args):\n \n     if options.applied:\n         applied = crt_series.get_applied()\n-        crt_series.pop_patch(applied[0])\n+        if applied != []:\n+            crt_series.pop_patch(applied[0])\n         __delete_empty(applied, True)\n \n     if options.unapplied:\n"},{"id":"8714","messageId":"20050916193522.18681.94911.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 09/11] Allow mailing a given patch list","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:22Z","receivedAt":"2005-09-16T19:35:22Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n\nI tried to mail a cherry-picked subset of my series and that didn't work - using\nstg export and quilt was even worse, so I had to code something.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/commands/mail.py |   15 ++++++---------\n 1 files changed, 6 insertions(+), 9 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -26,7 +26,7 @@ from stgit.config import config\n \n \n help = 'send a patch or series of patches by e-mail'\n-usage = \"\"\"%prog [options] [<patch>]\n+usage = \"\"\"%prog [options] [<patch> [<patch2...]]\n \n Send a patch or a range of patches (defaulting to the applied patches)\n by e-mail using the 'smtpserver' configuration option. The From\n@@ -265,9 +265,6 @@ def func(parser, options, args):\n     \"\"\"Send the patches by e-mail using the patchmail.tmpl file as\n     a template\n     \"\"\"\n-    if len(args) > 1:\n-        parser.error('incorrect number of arguments')\n-\n     if not config.has_option('stgit', 'smtpserver'):\n         raise CmdException, 'smtpserver not defined'\n     smtpserver = config.get('stgit', 'smtpserver')\n@@ -281,11 +278,11 @@ def func(parser, options, args):\n \n     applied = crt_series.get_applied()\n \n-    if len(args) == 1:\n-        if args[0] in applied:\n-            patches = [args[0]]\n-        else:\n-            raise CmdException, 'Patch \"%s\" not applied' % args[0]\n+    if len(args) >= 1:\n+        for patch in args:\n+            if not patch in applied:\n+                raise CmdException, 'Patch \"%s\" not applied' % patch\n+            patches = args\n     elif options.all:\n         patches = applied\n     elif options.range:\n"},{"id":"8715","messageId":"20050916193523.18681.46404.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 10/11] Fix \"stg mail\" address parsing for hyphen","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:23Z","receivedAt":"2005-09-16T19:35:23Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n\nTried sending an email cc'ing LKML - watched my postfix queue - and saw\nkernel@vger.kernel.org as delivery address! What had happened? StGIT didn't like\n\"linux-kernel\" ! Fix the regexp.\n\nI just added an hyphen to both sections (yes, there are plenty of domain names\nincluding hyphens, and I tested the problem there too). Don't know if other\nchars are missing.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/commands/mail.py |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -112,7 +112,7 @@ def __parse_addresses(string):\n     \"\"\"Return a two elements tuple: (from, [to])\n     \"\"\"\n     def __addr_list(string):\n-        return re.split('.*?([\\w\\.]+@[\\w\\.]+)', string)[1:-1:2]\n+        return re.split('.*?([-\\w\\.]+@[-\\w\\.]+)', string)[1:-1:2]\n \n     from_addr_list = []\n     to_addr_list = []\n"},{"id":"8708","messageId":"20050916193525.18681.4203.stgit@zion.home.lan","threadId":"1829","inReplyTo":"20050916193511.18681.24189.stgit@zion.home.lan","subject":"[patch 11/11] Detect description in quilt patches","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-09-16T19:35:25Z","receivedAt":"2005-09-16T19:35:25Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n\nThe current logic imports the whole quilt patch as description - the changes\nthemselves are correctly applied, luckily, but the description must be fixed up\nby hand.\nSo, detect \"Index: \" lines as patch start. I've heard rumors that also\nSubversion generates this format, so we become compatible with it, too.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n stgit/commands/imprt.py |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/commands/imprt.py b/stgit/commands/imprt.py\n--- a/stgit/commands/imprt.py\n+++ b/stgit/commands/imprt.py\n@@ -96,7 +96,8 @@ def __parse_mail(filename = None):\n \n     # the rest of the patch description\n     for line in f:\n-        if re.match('---\\s*$', line) or re.match('diff -', line):\n+        if re.match('---\\s*$', line) or re.match('diff -', line) or \\\n+                re.match('^Index: ', line):\n             break\n         else:\n             descr += line\n"},{"id":"8754","messageId":"1126945037.6941.1.camel@localhost.localdomain","threadId":"1829","inReplyTo":"20050916193513.18681.60765.stgit@zion.home.lan","subject":"Re: [patch 02/11] Make \"empty patch\" checking optional in \"series\" command.","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2005-09-17T08:17:17Z","receivedAt":"2005-09-17T08:17:17Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On Fri, 2005-09-16 at 21:35 +0200, Paolo 'Blaisorblade' Giarrusso wrote:\n> That's just too slow, and quilt doesn't do it, so user will live with it.\n> Don't know if there's a reason to allow dropping the fanciness here\n> entirely, but I think there's no user doing one-liner scripts with quilt\n> series. And anyway, for that you can do \"stg applied; stg unapplied\".\n> \n> Actually, with this patch you must ask explicitly the checking.\n\nAll the 11 patches applied. Thanks.\n\nOne note about this one - we could store the tree id as well in the\npatch information since it is generated by git.commit() anyway and it\nwould make the checking simpler. Anyway, in the meantime this patch is\nOK.\n\n-- \nCatalin\n"}]}