On 2009-04-28 16:10:25 +0100, Catalin Marinas wrote:
This patch adds the mechanism to check if the output is tty for the
diff and show commands and passes the --color option to git if the
color.diff config option is set auto or true. The patch also changes
the default pager to 'less -FRSX' from the diffcol.sh script.
Seems like a nice improvement.
+ # Set the PAGER environment to the config value if not already set
+ if not 'PAGER' in os.environ:
+ os.environ['PAGER'] = config.get('stgit.pager')
You can replace these two lines with
os.environ.setdefault('PAGER', config.get('stgit.pager'))
The only downside is that config.get() will be evaluated (and the
result discarded) even if PAGER _is_ set in the environment. But
config.get() should be dirt cheap, because we should be reading in all
the config values at once the first time we need one of them. But as I
recall we don't currently do that, so my one-liner might not be so
clever after all ...
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle