Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] tests: modernise style: more uses of test_line_count

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:33

Junio C Hamano [off-list ref] writes:
I'll squash this in, but otherwise it looks good.  There is nothing
conflicting in flight right now.
In case somebody is curious, I've eyeballed the result of applying this
patch to v1.7.10 and the result of running the following on v1.7.10 to
find these three.  The other differences looked fine; we lost a few
variables like $loglen but they are not otherwise used, which was harder
to see without enough context.

-- >8 --
#!/bin/sh

perl -i -p -e '
	s/test\s+\$\(wc\s+-l\s+<\s*([.\/a-zA-Z0-9_]+)\)\s+(?:=|-eq)\s+"?(\d+)"?
	    /test_line_count = $2 $1/x;
	s/test\s+"?(\d+)"?\s+(?:=|-eq)\s+\$\(wc\s+-l\s+<\s*([.\/a-zA-Z0-9_]+)\)
	    /test_line_count = $1 $2/x;
	s/test\s+\`wc\s+-l\s+<\s*([.\/a-zA-Z0-9_]+)\`\s+(?:=|-eq)\s+"?(\d+)"?
	    /test_line_count = $2 $1/x;
	s/test\s+"?(\d+)"?\s+(?:=|-eq)\s+\`wc\s+-l\s+<\s*([.\/a-zA-Z0-9_]+)\`
	    /test_line_count = $1 $2/x;
' t/t[0-9][0-9][0-9][0-9]-*.sh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help