git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGit PATCH] Make sure that the output of "stg status" is sorted

From
Karl Hasselström <kha@treskal.com>
Date
Sep 23, 2007, 23:52 UTC
Message-ID
<20070923235212.26396.53222.stgit@yoghurt>

This simplifies testing, but also makes it easier for the user to find specific files.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 stgit/commands/status.py |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/stgit/commands/status.py b/stgit/commands/status.py
index bbfb5df..b2835ab 100644
--- a/stgit/commands/status.py
+++ b/stgit/commands/status.py
@@ -91,12 +91,15 @@ def status(files = None, modified = False, new = False, deleted = False,
             filestat.append('?')
         cache_files = [x for x in cache_files if x[0] in filestat]
 
-    for fs in cache_files:
-        assert files == None or fs[1] in files
-        if not filtered:
-            out.stdout('%s %s' % (fs[0], fs[1]))
+    output = []
+    for st, fn in cache_files:
+        assert files == None or fn in files
+        if filtered:
+            output.append(fn)
         else:
-            out.stdout('%s' % fs[1])
+            output.append('%s %s' % (st, fn))
+    for o in sorted(output):
+        out.stdout(o)
 
 def func(parser, options, args):
     """Show the tree status
Message 1 of 1 in “Make sure that the output of "stg status" is sorted”
  1. Make sure that the output of "stg status" is sortedKarl Hasselström, Sep 23, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.