Re: [PATCH] get_sha1: improve ambiguity warning regarding SHA-1 and ref names

2013-05-07 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: That's an important feature for safety. When a script has created an object or learned about it some other way, as long as it doesn't abbreviate its name it can be sure that git commands will not misunderstand it. So I think this

[PATCH] get_sha1: improve ambiguity warning regarding SHA-1 and ref names

2013-05-03 Thread Nguyễn Thái Ngọc Duy
When we get 40 hex digits, we immediately assume it's an SHA-1. Warn about ambiguity if there's also refs/heads/$sha1 (or similar) on system. When we successfully resolve a ref like 1234abc and 1234abc happens to be valid abbreviated SHA-1 on system, warn also. Signed-off-by: Nguyễn Thái Ngọc