Does anyone have a good awk for svn log output?

I want to look for commit messages for a string, it's easy to connect the svn log to grep, but since the message and rev are on separate lines, this is a little more complicated.

i.e.

svn log./ | searchSvnMessages.awk artf29999

------------------------------------------------------------------------
r9303 | myuser | 2011-02-22 15:13:47 -0800 (Tue, 22 Feb 2011) | 1 line

artf29999: Adjusting Skin
------------------------------------------------------------------------
r9302 | myuser | 2011-02-22 14:11:06 -0800 (Tue, 22 Feb 2011) | 1 line

artf29999: Adding skinning.
------------------------------------------------------------------------
r800 | myuser | 2011-02-22 09:44:36 -0800 (Tue, 22 Feb 2011) | 1 line

artf29999: Adding functionality.

I was hoping someone else did the dirty work that I could piggyback?

+3
source share
2 answers

If you only need to search the first line of each log entry and you use GNU grep, you can do it svn log . | grep -B2 artf29999.

+7
source

svn log ... --xml xml-, . script .

+1

Source: https://habr.com/ru/post/1794239/


All Articles