GNU bug report logs -
#5211
Color escape codes in the output of vc-git-print-log
Previous Next
Reported by: Juanma Barranquero <lekktu <at> gmail.com>
Date: Mon, 14 Dec 2009 16:20:04 UTC
Severity: minor
Tags: patch
Found in version 23.1.90
Done: Juanma Barranquero <lekktu <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5211 in the body.
You can then email your comments to 5211 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Mon, 14 Dec 2009 16:20:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Mon, 14 Dec 2009 16:20:05 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
Package: emacs,vc
Tags: patch
Version: 23.1.90
Severity: minor
Depending of your setting of color.diff, color is used for log output,
and vc-print-log shows garbage (OK, escape codes for color):
^[[33mcommit 43a3bf88e5e495ad048b3a6d3cf852e1e7a02f1c^[[m
Author: xxx <yyy <at> zzz>
Date: 2009-12-14 17:11:35 +0200
blah blah blah
As color in *vc-change-log* buffers is an issue for font-locking, and
not for git log, the command should be called with --no-color.
OK to the following patch?
Juanma
2009-12-14 Juanma Barranquero <lekktu <at> gmail.com>
* vc-git.el (vc-git-print-log): Pass --no-color to `git log'.
=== modified file 'lisp/vc-git.el'
--- lisp/vc-git.el 2009-12-08 15:56:57 +0000
+++ lisp/vc-git.el 2009-12-14 16:08:54 +0000
@@ -555,7 +555,7 @@
(apply 'vc-git-command buffer
'async files
(append
- '("log")
+ '("log" "--no-color")
(when shortlog
'("--graph" "--decorate"
"--date=short" "--pretty=format:%d%h %ad %s" "--abbrev-commit"))
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 04:35:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 04:35:04 GMT)
Full text and
rfc822 format available.
Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
> * vc-git.el (vc-git-print-log): Pass --no-color to `git log'.
Would using a pipe rather than a tty solve the problem as well?
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 04:35:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 04:35:06 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 04:35:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 04:35:08 GMT)
Full text and
rfc822 format available.
Message #20 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Tue, Dec 15, 2009 at 05:27, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> Would using a pipe rather than a tty solve the problem as well?
I'm not sure I understand... Do you mean, would piping the output of
"git log" fix the problem? No, with color.diff=always, pipes get the
escape codes too.
Juanma
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 05:40:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 05:40:07 GMT)
Full text and
rfc822 format available.
Message #25 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Tue, 15 Dec 2009 05:31:02 +0100
> Cc: 5211 <at> emacsbugs.donarmstrong.com
> Reply-To: Juanma Barranquero <lekktu <at> gmail.com>,
> 5211 <at> emacsbugs.donarmstrong.com
>
> No, with color.diff=always, pipes get the escape codes too.
On what OS?
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 11:20:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 11:20:04 GMT)
Full text and
rfc822 format available.
Message #30 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
> On what OS?
Windows 7
I have
[color]
branch = always
diff = always
interactive = always
pager = true
status = always
ui = always
showbranch = always
in my .gitconfig, and
git log | more
in a personal repo shows
←[33mcommit ed210d6b291c13b3e2c6cbfed39ffd0e96d5b634←[m
Author: Juanma Barranquero <lekktu <at> gmail.com>
Date: 2009-12-14 18:58:38 +0100
That is not a bug in my setup or git, it's intended to pass color
escapes to less (which I usually use with git).
Juanma
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 13:05:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 13:05:05 GMT)
Full text and
rfc822 format available.
Message #35 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Tue, 15 Dec 2009 12:15:42 +0100
> Cc: 5211 <at> emacsbugs.donarmstrong.com, monnier <at> iro.umontreal.ca
>
> > On what OS?
>
> Windows 7
I asked because pipes on Windows have their quirks.
> I have
>
> [color]
> branch = always
> diff = always
> interactive = always
> pager = true
> status = always
> ui = always
> showbranch = always
>
> in my .gitconfig, and
>
> git log | more
>
> in a personal repo shows
>
> ←[33mcommit ed210d6b291c13b3e2c6cbfed39ffd0e96d5b634←[m
If the escapes go away when you remove "always", then there's no
problem here. And if we want to cater to users who set "always" like
you do, then resetting it in vc-git-print-log is IMO the way to go.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 13:15:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 13:15:07 GMT)
Full text and
rfc822 format available.
Message #40 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Tue, Dec 15, 2009 at 14:01, Eli Zaretskii <eliz <at> gnu.org> wrote:
> If the escapes go away when you remove "always", then there's no
> problem here.
Yes, they do indeed disappear.
> And if we want to cater to users who set "always" like
> you do, then resetting it in vc-git-print-log is IMO the way to go.
That's my thinking too.
Juanma
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 15:05:05 GMT)
Full text and
rfc822 format available.
Message #43 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
Juanma Barranquero <lekktu <at> gmail.com> writes:
> Package: emacs,vc
> Tags: patch
> Version: 23.1.90
> Severity: minor
>
>
> Depending of your setting of color.diff, color is used for log output,
> and vc-print-log shows garbage (OK, escape codes for color):
>
> ^[[33mcommit 43a3bf88e5e495ad048b3a6d3cf852e1e7a02f1c^[[m
> Author: xxx <yyy <at> zzz>
> Date: 2009-12-14 17:11:35 +0200
>
> blah blah blah
>
>
> As color in *vc-change-log* buffers is an issue for font-locking, and
> not for git log, the command should be called with --no-color.
>
> OK to the following patch?
>
> Juanma
>
>
> 2009-12-14 Juanma Barranquero <lekktu <at> gmail.com>
>
> * vc-git.el (vc-git-print-log): Pass --no-color to `git log'.
When did the --no-color option appear?
If we pass it by default, then it will break C-x v l for git versions
that do not support it.
If --no-color is old enough, the it might not matter...
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 15:50:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 15:50:06 GMT)
Full text and
rfc822 format available.
Message #48 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Tue, Dec 15, 2009 at 15:57, Dan Nicolaescu <dann <at> ics.uci.edu> wrote:
> When did the --no-color option appear?
> If we pass it by default, then it will break C-x v l for git versions
> that do not support it.
> If --no-color is old enough, the it might not matter...
Good question. According to the logs, in July 2006
commit fef88bb0134dfd47b4bd17e668bbb860588dcb39
Author: Junio C Hamano <junkio <at> cox.net>
Date: 2006-07-07 05:27:24 -0700
diff.c: --no-color to defeat diff.color configuration.
Signed-off-by: Junio C Hamano <junkio <at> cox.net>
which means, if I'm not mistaken, that it appeared in git 1.4.2.
Juanma
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 18:40:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Andreas Schwab <schwab <at> linux-m68k.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 18:40:05 GMT)
Full text and
rfc822 format available.
Message #53 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
Juanma Barranquero <lekktu <at> gmail.com> writes:
> Good question. According to the logs, in July 2006
>
>
> commit fef88bb0134dfd47b4bd17e668bbb860588dcb39
> Author: Junio C Hamano <junkio <at> cox.net>
> Date: 2006-07-07 05:27:24 -0700
>
> diff.c: --no-color to defeat diff.color configuration.
>
> Signed-off-by: Junio C Hamano <junkio <at> cox.net>
>
>
> which means, if I'm not mistaken, that it appeared in git 1.4.2.
$ git describe fef88bb0134dfd47b4bd17e668bbb860588dcb39
v1.4.1-91-gfef88bb
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 18:45:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 18:45:03 GMT)
Full text and
rfc822 format available.
Message #58 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Tue, Dec 15, 2009 at 19:32, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> $ git describe fef88bb0134dfd47b4bd17e668bbb860588dcb39
Thanks, I didn't remember that command.
> v1.4.1-91-gfef88bb
That's a beta for 1.4.2, isn't it?
Juanma
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Tue, 15 Dec 2009 23:40:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Andreas Schwab <schwab <at> linux-m68k.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Tue, 15 Dec 2009 23:40:05 GMT)
Full text and
rfc822 format available.
Message #63 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
Juanma Barranquero <lekktu <at> gmail.com> writes:
> On Tue, Dec 15, 2009 at 19:32, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>
>> $ git describe fef88bb0134dfd47b4bd17e668bbb860588dcb39
>
> Thanks, I didn't remember that command.
>
>> v1.4.1-91-gfef88bb
>
> That's a beta for 1.4.2, isn't it?
That just means the commit is 91 commits after tag v1.4.1, and there is
no other tag in between.
$ git tag --contains fef88bb0134dfd47b4bd17e668bbb860588dcb39 | head -1
v1.4.2
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
:
bug#5211
; Package
emacs,vc
.
(Wed, 16 Dec 2009 00:05:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com
.
(Wed, 16 Dec 2009 00:05:05 GMT)
Full text and
rfc822 format available.
Message #68 received at 5211 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Wed, Dec 16, 2009 at 00:34, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> That just means the commit is 91 commits after tag v1.4.1, and there is
> no other tag in between.
OK, thanks.
> $ git tag --contains fef88bb0134dfd47b4bd17e668bbb860588dcb39 | head -1
> v1.4.2
So --no-color was first included in a release of 2006-08-13. Is that
old enough? (git 1.0.0 is from 2005-12-21, barely eight months
earlier, so 1.4.2 is quite old indeed).
Juanma
Reply sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
You have taken responsibility.
(Mon, 28 Dec 2009 02:49:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
bug acknowledged by developer.
(Mon, 28 Dec 2009 02:49:02 GMT)
Full text and
rfc822 format available.
Message #73 received at 5211-done <at> debbugs.gnu.org (full text, mbox):
On Wed, Dec 16, 2009 at 00:57, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> So --no-color was first included in a release of 2006-08-13. Is that
> old enough? (git 1.0.0 is from 2005-12-21, barely eight months
> earlier, so 1.4.2 is quite old indeed).
I've committed this change (with the acquiescence of Chong Yidong).
Juanma
bug archived.
Request was from
Debbugs Internal Request <bug-gnu-emacs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 25 Jan 2010 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 15 years and 149 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.