explain-git-with-d3 icon indicating copy to clipboard operation
explain-git-with-d3 copied to clipboard

Support referencing a unique abbreviated commit hash, like “bb92”

Open roryokane opened this issue 10 years ago • 0 comments

In the git checkout example, I tried to type git checkout bb92 to check out the commit labeled “bb92e0e…” on the graph. I got the error “Cannot find commit: bb92”. I had to type the full 7-character name to perform the checkout command.

Abbreviated commits hashes should work, to save the user typing when exploring Git. The command line should only display an error if the hash is ambiguous, like “Ambiguous abbreviated ref: e”, or if no commit begins with that prefix, like “No such ref: 123”.

The code that identifies a ref given its name is getCommit in historyview.js.

roryokane avatar Mar 25 '15 07:03 roryokane