Detect git and hg via CLI commands