[PATCH 5/7] Add facility to print short list of patches around 'top'

From: Chuck Lever <cel@netapp.com>
Date: 2005-11-30 09:09:47
When working in the middle of a very long series, I often find it useful
to have a list of the patches right around the current patch.  Add an
option to "stg series" called "--short" to provide this short list.

Signed-off-by: Chuck Lever <cel@netapp.com>
---

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

diff --git a/stgit/commands/series.py b/stgit/commands/series.py
index a843307..ec1aaaf 100644
--- a/stgit/commands/series.py
+++ b/stgit/commands/series.py
@@ -39,6 +39,9 @@ options = [make_option('-b', '--branch',
            make_option('-e', '--empty',
                        help = 'check whether patches are empty '
                        '(much slower)',
+                       action = 'store_true'),
+           make_option('-s', '--short',
+                       help = 'list just the patches around the topmost patch',
                        action = 'store_true') ]
 
 
@@ -66,6 +69,13 @@ def func(parser, options, args):
 
     applied = crt_series.get_applied()
     unapplied = crt_series.get_unapplied()
+
+    if options.short:
+        if len(applied) > 5:
+            applied = applied[-6:]
+        if len(unapplied) > 5:
+            unapplied = unapplied[:5]
+
     patches = applied + unapplied
 
     max_len = 0

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Nov 30 09:10:14 2005

This archive was generated by hypermail 2.1.8 : 2005-11-30 09:13:50 EST