git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFD] Git glossary: 'branch' and 'head' description

From
Jakub Narebski <jnareb@gmail.com>
Date
May 21, 2006, 08:30 UTC
Message-ID
<e4p8e8$uqt$2@sea.gmane.org>
In-Reply-To
<87y7wyv72m.fsf@morpheus.hq.vtech>
David Kågedal wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
[...]
Show 13 quoted lines
>> So from the user's point of view, 'branch' is simply _named line of
>> development_. Refer to topic and tracking branches.
> 
> But the definition of 'branch' in git is quite different from the
> definition in CVS or many other systems.  It CVS, each revision
> (commit) belongs to a branch, and the branch is a linear sequence of
> revisions, not a full DAG.  In git, a commit doesn't really "belong"
> in any specific branch.
> 
> So, while it makes sense to describe branches as "lines of
> development" in general terms, it is also important to note the
> specific meaning of 'branch' in the context of git; i.e. as the
> history of a single head commit.

We can always say that branch is 1-st parent linear history of head branch, up to unmarked but computable branching/fork/creation point, i.e.

  {i = 0..N: branch-head~i}
where N is the length of the branch.
BTW. HEAD~0 == HEAD, isn't it?
-- 
Jakub Narebski
Warsaw, Poland
Previous: Shawn Pearce
Message 13 of 13 in “[RFD] Git glossary: 'branch' and 'head' description”
  1. Jakub NarebskiMay 17, 2006
  2. Junio C HamanoMay 17, 2006
  3. Jakub NarebskiMay 17, 2006
  4. Junio C HamanoMay 17, 2006
  5. Jakub NarebskiMay 17, 2006
  6. David KågedalMay 19, 2006
  7. Shawn PearceMay 19, 2006
  8. Daniel BarkalowMay 20, 2006
  9. Junio C HamanoMay 20, 2006
  10. Daniel BarkalowMay 20, 2006
  11. Linus TorvaldsMay 20, 2006
  12. Shawn PearceMay 21, 2006
  13. Jakub NarebskiMay 21, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.