Improve finding commit for changeset number

Because commits can be shared across branches, it is better to do a single
search starting from the branches than to do a search for each branch
separately. The revision walking implemented in the git library will take
care of efficiently enumerating the graph, not visiting shared commits
multiple times.
Merge pull request #531 from kgybels/improve_find_commit_by_id

Improve finding commit for changeset number