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

Re: [ANNOUNCE] Stacked Git 0.15-rc1

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Jul 13, 2009, 22:06 UTC
Message-ID
<b0943d9e0907131506s329bc2c2qe35180ac783a52f3@mail.gmail.com>
In-Reply-To
<20090713174743.GB29333@skywalker>
2009/7/13 Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>:
Show 10 quoted lines
> On Mon, Jul 13, 2009 at 10:50:17PM +0530, Aneesh Kumar K.V wrote:
>> On Mon, Jul 13, 2009 at 06:07:06PM +0100, Catalin Marinas wrote:
>> > 2009/7/13 Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>:
>> > > stg show now gives me output like below
>> > >
>> > > ESC[1mdiff --git a/fs/nfs/nfs4acl.c b/fs/nfs/nfs4acl.cESC[m
>> > > ESC[1mindex 09946da..c9a6dee 100644ESC[m
>> > > ESC[1m--- a/fs/nfs/nfs4acl.cESC[m
>> > > ESC[1m+++ b/fs/nfs/nfs4acl.cESC[m
>> > > ESC[36m@@ -37,6 +37,7 @@ESC[m
[...]
> I had PAGER=less in my .bashrc. I had set it that way because of
> https://bugs.launchpad.net/ubuntu/+source/less/+bug/67381
>
> Removing that fixed the problem

Thanks. You shouldn't remove that actually. The patch below should give similar behaviour to Git (added to the "proposed" branch):

Set the LESS environment if the pager is 'less'
From: Catalin Marinas <catalin.marinas@arm.com>

This fixes the coloured output if the PAGER environment is set to less (similar behaviour to Git).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
 stgit/config.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/stgit/config.py b/stgit/config.py
index f205e5b..75bdadb 100644
--- a/stgit/config.py
+++ b/stgit/config.py
@@ -37,7 +37,7 @@ class GitConfig:
         'stgit.keepoptimized':	'no',
         'stgit.extensions':	'.ancestor .current .patched',
         'stgit.shortnr': '5',
-        'stgit.pager':  'less -FRSX'
+        'stgit.pager':  'less'
         }

     __cache = None
@@ -121,6 +121,8 @@ def config_setup():
     global config

     os.environ.setdefault('PAGER', config.get('stgit.pager'))
+    if os.environ.get('PAGER').startswith('less'):
+        os.environ.setdefault('LESS', '-FRSX')
     # FIXME: handle EDITOR the same way ?

 class ConfigOption:
-- 
Catalin
Previous: Aneesh Kumar K.VNext: Linus Torvalds
Message 9 of 13 in “[ANNOUNCE] Stacked Git 0.15-rc1”
  1. Catalin MarinasJul 12, 2009
  2. Uwe Kleine-KönigJul 13, 2009
  3. Catalin MarinasJul 14, 2009
  4. Karl WibergJul 13, 2009
  5. Aneesh Kumar K.VJul 13, 2009
  6. Catalin MarinasJul 13, 2009
  7. Aneesh Kumar K.VJul 13, 2009
  8. Aneesh Kumar K.VJul 13, 2009
  9. Catalin MarinasJul 13, 2009
  10. Linus TorvaldsJul 13, 2009
  11. Catalin MarinasJul 14, 2009
  12. Larry D'AnnaJul 14, 2009
  13. Catalin MarinasJul 14, 2009

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.