{"thread":{"id":"16635","subject":"[StGit PATCH] Use separate column for zero in output of stg series -e.","startedAt":"2008-12-08T13:57:32Z","lastAt":"2008-12-08T14:11:40Z","messageCount":2,"participants":["David Kågedal","Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"97347","messageId":"20081208135648.22274.71945.stgit@krank","threadId":"16635","inReplyTo":null,"subject":"[StGit PATCH] Use separate column for zero in output of stg series -e.","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2008-12-08T13:57:32Z","receivedAt":"2008-12-08T13:57:32Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"This will make the output more regular and easier to parse. It no longer\noverwrites the +/-/! status flag with a zero for empty patches, and\ninstead puts the zero before it.\n\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\nThis is a fix for https://gna.org/bugs/index.php?12718\n\n stgit/commands/series.py |   17 ++++++++++-------\n 1 files changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/stgit/commands/series.py b/stgit/commands/series.py\nindex 95196d3..b93abc4 100644\n--- a/stgit/commands/series.py\n+++ b/stgit/commands/series.py\n@@ -79,13 +79,16 @@ def __get_author(stack, patch):\n     cd = stack.patches.get(patch).commit.data\n     return cd.author.name\n \n-def __print_patch(stack, patch, branch_str, prefix, empty_prefix, length, options):\n+def __print_patch(stack, patch, branch_str, prefix, length, options):\n     \"\"\"Print a patch name, description and various markers.\n     \"\"\"\n     if options.noprefix:\n         prefix = ''\n-    elif options.empty and stack.patches.get(patch).is_empty():\n-        prefix = empty_prefix\n+    elif options.empty:\n+        if stack.patches.get(patch).is_empty():\n+            prefix = '0' + prefix\n+        else:\n+            prefix = ' ' + prefix\n \n     patch_str = branch_str + patch\n \n@@ -180,12 +183,12 @@ def func(parser, options, args):\n \n     if applied:\n         for p in applied[:-1]:\n-            __print_patch(stack, p, branch_str, '+ ', '0 ', max_len, options)\n-        __print_patch(stack, applied[-1], branch_str, '> ', '0>', max_len,\n+            __print_patch(stack, p, branch_str, '+ ', max_len, options)\n+        __print_patch(stack, applied[-1], branch_str, '> ', max_len,\n                       options)\n \n     for p in unapplied:\n-        __print_patch(stack, p, branch_str, '- ', '0 ', max_len, options)\n+        __print_patch(stack, p, branch_str, '- ', max_len, options)\n \n     for p in hidden:\n-        __print_patch(stack, p, branch_str, '! ', '! ', max_len, options)\n+        __print_patch(stack, p, branch_str, '! ', max_len, options)\n"},{"id":"97348","messageId":"20081208141140.GA4813@diana.vm.bytemark.co.uk","threadId":"16635","inReplyTo":"20081208135648.22274.71945.stgit@krank","subject":"Re: [StGit PATCH] Use separate column for zero in output of stg series -e.","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-12-08T14:11:40Z","receivedAt":"2008-12-08T14:11:40Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-12-08 14:57:32 +0100, David Kågedal wrote:\n\n> This will make the output more regular and easier to parse. It no\n> longer overwrites the +/-/! status flag with a zero for empty\n> patches, and instead puts the zero before it.\n\nGood idea -- I very much doubt there exists any script that will be\nbroken by the format change, since the current format is icky to\nparse. And the implementation looks sane too.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}