Re: [PATCH] Colorized git log
- From
Petr Baudis <pasky@ucw.cz>
- Date
- Apr 22, 2005, 00:54 UTC
- Message-ID
- <20050422005452.GZ7443@pasky.ji.cz>
- In-Reply-To
- <f0796bb7050421174647943f0c@mail.gmail.com>
Dear diary, on Fri, Apr 22, 2005 at 02:46:19AM CEST, I got a letter where Daniel Serpell <daniel.serpell@gmail.com> told me that...
> Hi!
Hi,
Show 6 quoted lines
> On 4/21/05, Petr Baudis <pasky@ucw.cz> wrote: > > > > I made git log colorized if you pass it -c in current git-pasky. > > > > This has two problems, solved in two patches:
could you please sign them off?
> * A space is added in front of header lines when you use color.
Oh, good catch, thanks.
> * It does not work in my (Debian) xterm. This is because here > "setterm" only works with TERM=linux.
Duh. And they say "Where possible terminfo is consulted to find the string to use." in their manual page. :/
Show 20 quoted lines
> gitlog.sh: 6d24d857fb6c2f7e810954adaca1990599906f07 > --- a/gitlog.sh > +++ b/gitlog.sh > @@ -11,11 +11,11 @@ > > if [ "$1" = "-c" ]; then > shift > - colheader=$(setterm -foreground green) > - colauthor=$(setterm -foreground cyan) > - colcommitter=$(setterm -foreground magenta) > - colsignoff=$(setterm -foreground yellow) > - coldefault=$(setterm -foreground default) > + colheader="$(tput setaf 2)" > + colauthor="$(tput setaf 6)" > + colcommitter="$(tput setaf 5)" > + colsignoff="$(tput setaf 3)" > + coldefault="$(tput op)" > else > colheader= > colauthor=
Please at least stick the colors in comments after the assignment. Not everyone knows ANSI color codes off-hand (the last thing I've memorized were BIOS color codes in the distant DOS days).
-- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor