From: Junio C Hamano Date: Mon, 25 Jun 2012 17:01:06 GMT Subject: Re: [PATCH/RFC] git-svn: don't create master if another head exists Message-ID: <7vehp3gwbx.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120625075726.GO3125@beczulka> Marcin Owsiany writes: >> What are you really trying >> to validate? "HEAD" points at an existing branch and you do not >> care what branch it is? > > Yes. I think. Why do you even care about the value of HEAD, i.e. the output from "rev-parse HEAD", if that is the case? Wouldn't you rather be reading from the output "symbolic-ref HEAD" to see if it points at any branch? >> HEAD may not even point at a valid branch >> but can be detached as long as it happens to point at a commit that >> is at the tip of some branch (hence building further commit on HEAD >> will break the condition you are checking in the above code)? > > The more questions you ask, the less I feel I know about how git works > :-)