All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Kågedal" <davidk@lysator.liu.se>
To: catalin.marinas@gmail.com, kha@treskal.com
Cc: git@vger.kernel.org, mandolaerik@gmail.com, gustav@virtutech.com
Subject: [StGit PATCH] Use separate column for zero in output of stg series -e.
Date: Mon, 08 Dec 2008 14:57:32 +0100	[thread overview]
Message-ID: <20081208135648.22274.71945.stgit@krank> (raw)

This will make the output more regular and easier to parse. It no longer
overwrites the +/-/! status flag with a zero for empty patches, and
instead puts the zero before it.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---

This is a fix for https://gna.org/bugs/index.php?12718

 stgit/commands/series.py |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/stgit/commands/series.py b/stgit/commands/series.py
index 95196d3..b93abc4 100644
--- a/stgit/commands/series.py
+++ b/stgit/commands/series.py
@@ -79,13 +79,16 @@ def __get_author(stack, patch):
     cd = stack.patches.get(patch).commit.data
     return cd.author.name
 
-def __print_patch(stack, patch, branch_str, prefix, empty_prefix, length, options):
+def __print_patch(stack, patch, branch_str, prefix, length, options):
     """Print a patch name, description and various markers.
     """
     if options.noprefix:
         prefix = ''
-    elif options.empty and stack.patches.get(patch).is_empty():
-        prefix = empty_prefix
+    elif options.empty:
+        if stack.patches.get(patch).is_empty():
+            prefix = '0' + prefix
+        else:
+            prefix = ' ' + prefix
 
     patch_str = branch_str + patch
 
@@ -180,12 +183,12 @@ def func(parser, options, args):
 
     if applied:
         for p in applied[:-1]:
-            __print_patch(stack, p, branch_str, '+ ', '0 ', max_len, options)
-        __print_patch(stack, applied[-1], branch_str, '> ', '0>', max_len,
+            __print_patch(stack, p, branch_str, '+ ', max_len, options)
+        __print_patch(stack, applied[-1], branch_str, '> ', max_len,
                       options)
 
     for p in unapplied:
-        __print_patch(stack, p, branch_str, '- ', '0 ', max_len, options)
+        __print_patch(stack, p, branch_str, '- ', max_len, options)
 
     for p in hidden:
-        __print_patch(stack, p, branch_str, '! ', '! ', max_len, options)
+        __print_patch(stack, p, branch_str, '! ', max_len, options)

             reply	other threads:[~2008-12-08 13:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-08 13:57 David Kågedal [this message]
2008-12-08 14:11 ` [StGit PATCH] Use separate column for zero in output of stg series -e 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=20081208135648.22274.71945.stgit@krank \
    --to=davidk@lysator.liu.se \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gustav@virtutech.com \
    --cc=kha@treskal.com \
    --cc=mandolaerik@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.