Add option to query commit messages

Change-Id: If232c326525f516931b885c55f549049ad470b8d