From: Junio C Hamano Date: Thu, 15 Dec 2005 00:37:15 GMT Subject: Re: new file leaked onto release branch Message-ID: <7v7ja7ures.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Johannes Schindelin writes: > So, it could have been > > git pull . 5165 > > which mistakes 5165 for a short SHA1? I do not think git-pull would work on arbitrary SHA1 expressions, so you should be safe. Interestingly... $ git rev-parse 5165 error: short SHA1 5165 is ambiguous. 5165 that short SHA1 is ambiguous. But a branch name immediately under .git/refs/heads takes precedence: $ git branch 5165 master $ git rev-parse 5165 master acd9b7b4e08a3f0f48afa922d8e371414cf2d3b2 acd9b7b4e08a3f0f48afa922d8e371414cf2d3b2 And this makes it safer and unambiguous: $ git branch -d 5165 Deleted branch 5165. $ git branch bug/5165 master $ git rev-parse bug/5165 acd9b7b4e08a3f0f48afa922d8e371414cf2d3b2 We might want to detect collisions between SHA1 prefix and branch names, but I am not sure if it is worth it in practice.