Re: [StGit PATCH 9/9] Use the default git colouring scheme rather than specific scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx
      www.treskal.com/kalle
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]