emacs-devel
[Top][All Lists]
Advanced

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

Re: Obscure error/warning/information message from git pull


From: Stephen J. Turnbull
Subject: Re: Obscure error/warning/information message from git pull
Date: Thu, 20 Nov 2014 03:40:27 +0900

Sergey Organov writes:

 > Branch /in Git/ is just a special kind of label, and nothing else.

Those labels are /branch refs/.

 > The above is an abstraction built on top of Git's idea of
 > branch. One can get a chain of commits from Git DAG starting at
 > branch 'foo' and call the result "branch foo", if it suits
 > him.

And that's precisely what everyone does, IME.  In particular, "git
help branch" clearly presupposes that notion of "branch" throughout.
All DAGgy operations on branches operate on that chain of commits.
There are operations on the ref itself (create, move, delete, parse),
but those are not considered to be operations on the branch by me or
anyone I know.

 > Moreover, he can do this from any reference, even from
 > SHA1. If I get the same chain of commits from branch 'foo' and from
 > commit AF03276BC, is it the same branch? Is SHA1 a branch? Is Git
 > tag a branch? Why?

Maybe, no, and no.  Sometimes a chain of commits including the tip
commit is called a branch, but that's synecdoche (an expression where
a part is used to stand for the whole).  And of course it's possible
to create a branch that does not contain a tip commit (ie, a childless
commit), by branching off a non-tip commit (of course once you commit
to that branch, it will have a tip commit).  So properly speaking a
branch must contain both a chain of commits *and* a head which will
become the parent of the next commit to that branch.

SHA1 and tag clearly aren't branches because if checked out they
become detached heads, and if a commit is performed in that state, a
commit object is created and HEAD is updated to point to the new
commit, but the SHA1 and the tag are not updated.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]