Re: new file leaked onto release branch
- From
Junio C Hamano <junkio@cox.net>
- Date
- Dec 15, 2005, 00:37 UTC
- Message-ID
- <7v7ja7ures.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.63.0512150034120.8992@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
> 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.
5165that 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
acd9b7b4e08a3f0f48afa922d8e371414cf2d3b2And this makes it safer and unambiguous:
$ git branch -d 5165
Deleted branch 5165.
$ git branch bug/5165 master
$ git rev-parse bug/5165
acd9b7b4e08a3f0f48afa922d8e371414cf2d3b2We might want to detect collisions between SHA1 prefix and branch names, but I am not sure if it is worth it in practice.