Filtering Log Messages
When you have 40-50 revisions and a couple of projects, finding a particular revision is pretty easy. When you have three years of history, 20 active projects and revisions in the high five or low six digits, locating a specific revision can be an adventure. (And by adventure we’re not talking about a trip to Disneyland, we’re talking about the running out of gas 20 miles from the nearest town in 2 feet of snow, at night, type of adventure.)
First of all, finding a specific revision becomes a lot easier if you have some standards:
- Always put in log messages. Not just for commits, but for copies, deletes, renames, anytime you are prompted for one.
- For certain activities, have a defined structure. “Fixed bug #1431”, “Added Feature #5r31a”, “Created Branch”, “Deleted Branch”.
- Use training, published “Policies and Procedures”, hook scripts and active management to ensure that proper log messages are added.
Luckily in TortoiseSVN you can filter (search) for log messages. In fact, you can search for log messages as well as the text of authors, dates, and paths. But mostly you will search on log messages.
Let’s look at an example of filtering. In the picture below we have a standard of entering the log message “Working on Bug #nnnn” or “Fixed Bug #nnnn” depending on whether the development effort is underway or finished. The first image shows our results, pre-filter and the second picture shows filtering on the bug number “5100”.
Log messages with no filtering.

Filtering on the string “5100”.

But let’s say we want only those revisions with the bug number “5100” but not containing the string “Working”. This would give us the revision where the bug was fixed.

The filter “ 5100 -Working” would look for all messages containing the string “5100” but NOT the string “Working”.
The minus sign (-) means without.
Note: The filter “5100 -WoRkIng“ would generate the same results. Case is ignored.
Other examples of filtering:
- Sort -Marketing +Finance – searches for strings containing both Sort but not Marketing, or strings which contain Finance.
- !Sort Report – searches for strings which do not contain both Sort and Report
- “Finance Reporting” – searches for the literal expression “Finance Reporting”

You can also use regular expressions to limit your searches by selecting this option. An example of a regular expression would be:
- Market(ing|ers) – which would find messages with Marketing or Marketers.

But that will be covered in another blog.