lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Navigate by color in `git-diff --color-moved=plain`


From: Vadim Zeitlin
Subject: Re: [lmi] Navigate by color in `git-diff --color-moved=plain`
Date: Wed, 24 Apr 2019 23:13:36 +0200

On Wed, 24 Apr 2019 20:14:17 +0000 Greg Chicares <address@hidden> wrote:

GC> When making successive revisions to lmi's build system, I find it
GC> useful to run a command like the following, which wipes everything
GC> clean and then rebuilds the lmi world from scratch, in a 'set -vx'
GC> script that echoes every step into a log file:
GC> 
GC> make raze; logfile=log-`date -u +'%Y%m%dT%H%MZ'`; echo "Log file is 
'$logfile.tar.bz2'."; ./install_msw.sh >$logfile 2>&1; tar -cjf 
$logfile.tar.bz2 $logfile; mv ${logfile}* ..
GC> 
GC> and then compare the latest log to the last known-good log.
[...]
GC> and indeed after '-r' I can search for '/[[]3[12]m'. But of course
GC> '-r' makes everything the same color and shows escape sequences
GC> literally, when ideally I'd like to see the colorized output but
GC> search by (invisible) escape sequence. Does that seem possible?

 Is there anything wrong with the trivial solution of piping the diff
through grep selecting only the red/green lines? This would lose all
context, of course, but if the goal is to just check that there are no
unexpected changes, this shouldn't matter.

 I.e. perhaps you should try

        git diff --no-index --color=always --color-moved=plain ... |grep 
'^.\[3[12]'|less

and see if this is enough? Note that I used "." as I'm not sure how to grep
for U+001B, I can enter it as "Ctrl-V Esc" interactively, but this doesn't
translate well to the email medium.

 Also, I use just less because I already have "-eiFRMX" in my LESS
environment variable and I think so do you, but if you don't, you'd need to
use at least "-R" explicitly to see the colours.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]