Re: [PATCH 00/28] Use main as default branch name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Sergey Organov <sorganov@xxxxxxxxx> writes:
>
>> To me "not on a branch [tip]" is also confusing, as in fact you are, as
>> is easily seen after you perform a few commits, and now HEAD points
>> directly to the tip of the branch (that has no other references).
>
> Aren't you confused about what "on a branch" means?

I believe I'm not.

>
> After either of these two operations, your HEAD may point at the
> same commit, but the former is on a branch (the master branch), and
> the latter is not.
>
>     git checkout master
>     git checkout master^0
>
> The difference between these two states does *NOT* come from which
> commit HEAD points at.

Sure.

>
> The difference comes from what happens when you make a new commit
> starting from that state.  The former (i.e. you are on a branch)
> grows the branch.

Sure.

> The latter (i.e. you are not on a branch) does not grow any branch.

That's one way of looking at it, resulting in this "detached HEAD"
thingy that is too technical for the git user proper, I think. Moreover,
it immediately raises the question: if it doesn't grow any branch, /what/
does it grow?

Another way of describing it, that I prefer, is that you /are/ on an
/unnamed/ branch and new commits grow this particular /unnamed/ branch.
No need not only for "detached", but even for "HEAD" to be known to the
user to get the idea, I think.

>
> This is an unrelated trivia, but did anybody know that we were
> pretty much on the detached HEAD all the time for more than a month
> of early life of Git, until cad88fdf (git-init-db: set up the full
> default environment, 2005-05-30)?

I was not aware, and it seems that in my terminology it'd sound: "Git
didn't have named branches until cad88fdf".

-- Sergey



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux