From: Alex Riesen Date: Wed, 26 Oct 2005 20:47:27 GMT Subject: Re: [PATCH 1/4] git-init-db should error out with a message Message-ID: <20051026204727.GA19846@steel.home> In-Reply-To: <7v3bmoc9d7.fsf@assigned-by-dhcp.cox.net> Junio C Hamano, Wed, Oct 26, 2005 22:27:00 +0200: > > Not just that. It would be interesting to give the user an option to > > use the file references ("ref: refs/heads/master"). > > Actually, the users should not have to care how HEAD reference > is implemented. It might make sense to use regular file symref > regardless of platforms (i.e. never define USE_SYMLINK_HEAD on > any platform). This my idea too. All the time I was doing that patch :) > HOWEVER, I think "falling back" (both in Johannes' patch which > is in the "master" branch, and your version) has a funny failure > mode. What happens when two processes try redirecting .git/HEAD > simultaneously, possibly to different branch heads? Both of > them unlink(), one successfully does symlink(), and the other > gets EEXIST and falls back to create regular file symref. I think the file ref version uses rename of HEAD.lock into HEAD, doesn't it? Rename(2) should just remove the symlink, right?