Make FormatCommon do not create an empty 'bucket tree' when deserializing
Fix RevTree.EMPTY to have a proper SHA id.

The RevTree.EMPTY "null object" had ObjectId.NULL as its identifier
instead of the proper SHA id that would result of hashing an empty tree.
This lead to a bunch of "special cases" instead of helping out.

This patch makes it so that RevTree.EMPTY has a proper hashed identifier,
updates InitOp to initialize the WORK_TREE and STAGE_TREE refs accordingly,
reduces the number of special checks.

Note for the sake of safety, InitOp also makes sure that the real
empty tree exists in the ObjectDatabase.
Fix DiffCount to return the correct number of affected trees.

DiffCount was computing the correct number of affected trees
of a diff only if a tree was fully added or removed. The test
expectations were also wrong.

This patch fixes DiffCountConsumer to increment the tree counter
when there are deeper diffs to check too, fixes the unit and
functional test expectations that were wrong, and removes the
unnecessary DiffCount.setReportTrees(boolean) setting.
add a treeId.isNull() temporary until the RevTree.EMPTY clean up arrives
Make FormatCommon do not create an empty 'bucket tree' when deserializing
Merge pull request #745 from groldan/diffcount_fix_for_treecount

Fix DiffCount changed trees counter
don't use ANSI color codes on piped output from geogit-cli
Merge pull request #746 from groldan/rev_tree_empty_fix

Fix RevTree.EMTPY to have a proper SHA
Add --count option to cli's diff command
Huge performance improvement to compute the number of changes with path filtering.

This patch introduces two new methods to the DiffTreeVisitor.Consumer interface:
endTree(Node left, Node right):void and
endBucket(int bucketIndex, int bucketDepth, Bucket left, Bucket right)
that are called after the tree(...):boolean and bucket(...):bookean respectively,
regardless of their return value.

This allows consumers to keep track of more info like what the current tree
path is at any given event.

With that in mind, DiffCountConsumer is updated to use a filtering decorator
when path filters are given, and hence get rid of the separate code path it
was using for that case, that forced a full traversal of a DiffTreeIterator.

This results in an impressive performance improvement as now DiffCountConsumer
can skip whole trees and buckets and address only the ones that can possibly
match one of the path filters.

In a repo of ~2M osm features with ~1M changes between the diff'ed commits,
and filtering with 10 path filters, we're talking of an avg execution time
of ~5 milliseconds as opposed to ~3000 milliseconds.
Update diff man page with the new --count option
Merge pull request #747 from groldan/diffcount_filtered_improvements

Performance improvements for DiffCount/diff --count
Remove unnecesary check for null id after 16cb52117 is merged