[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
- [lmi] Navigate by color in `git-diff --color-moved=plain`, Greg Chicares, 2019/04/24
- Re: [lmi] Navigate by color in `git-diff --color-moved=plain`,
Vadim Zeitlin <=
- Re: [lmi] Navigate by color in `git-diff --color-moved=plain`, Greg Chicares, 2019/04/24
- Re: [lmi] Navigate by color in `git-diff --color-moved=plain`, Vadim Zeitlin, 2019/04/24
- Re: [lmi] Navigate by color in `git-diff --color-moved=plain`, Greg Chicares, 2019/04/25
- Re: [lmi] Navigate by color in `git-diff --color-moved=plain`, Greg Chicares, 2019/04/25
- Re: [lmi] Making "dash -x" more atomic (was: Navigate by color in `git-diff --color-moved=plain`), Vadim Zeitlin, 2019/04/25
- Re: [lmi] Making "dash -x" more atomic, Greg Chicares, 2019/04/25
- Re: [lmi] Making "dash -x" more atomic, Vadim Zeitlin, 2019/04/29
- Re: [lmi] Making "dash -x" more atomic, Greg Chicares, 2019/04/29
- Re: [lmi] Making "dash -x" more atomic, Vadim Zeitlin, 2019/04/29
Re: [lmi] Navigate by color in `git-diff --color-moved=plain`, Vadim Zeitlin, 2019/04/24