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

Re: What are branches?

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 24, 2009, 13:08 UTC
Message-ID
<200904241508.08569.jnareb@gmail.com>
In-Reply-To
<20090420202329.GB17241@atjola.homenet>
On Mon, 20 April 2009, Björn Steinbrink wrote:
Show 13 quoted lines
> On 2009.04.20 11:59:38 -0700, Jakub Narebski wrote:
> > Björn Steinbrink <B.Steinbrink@gmx.de> writes:
> > 
> > > If you go out, and look at a tree lit-up by the evil daystar, branches
> > > start at the trunk and end at their tip. The trunk isn't part of the
> > > branch.  [...]
> > 
> > Well, you have to remember that the 'branch' metaphor should not be
> > taken too literaly; take for example merges which do not have
> > equivalent in a tree build.
> 
> True, but that just happened to fit the task-oriented branch view so
> well, and I wanted the reference to the evil daystar (obviously ;-)).

Also in (botanical) trees you can usually distinguish between trunk and side branches, and I think in most cases also which branch forked from which one. Making one of branches (trunk) special might make sense for centralized version control systems like CVS (1.2 vs 1.2.2.4 version numbers) or Subversion (<project>/trunk for trunk (main branch) vs <project>/branches/<branchname>; although this is only convention and is not enforced by the tool), but in my opinion contradicts distributed nature of distributed SCM such like Git (and Mercurial).

Show 7 quoted lines
> > But if we are talking about literal branches: take a closer loog at
> > the tip of tree (plant) branch.  You can find growong tip there
> > (apical meristem) where new cells grow.  In Git you have 'branches'
> > (branch heads) where you create new commits...
> 
> Yeah, see the end of my mail, where I said that git has a mechanism to
> control where branches grow. Seems to fit :-)

The difference is that you can (usually) see which branch was first. It is not the case for Git (and it wouldn't make sense, as for DSCM there is no sense of 'first' wrt. time).

Show 7 quoted lines
> > But I agree that there isn't for example true notion of 'trunk' in
> > git, and this is what allows Git to be truly distributed...
> 
> Hm, not just no trunk, but also no branches that have a starting point
> and an end point. In general, you can't say "My branch starts _here_"
> unless you use the root commit(s) as the starting point, or you apply
> "extra" knowledge (you know from which other branch this branch forked).

Well, you can use reflog... if it is not expired. Or the tracking info in a config.

-- 
Jakub Narebski
Poland
Previous: Björn SteinbrinkNext: Björn Steinbrink
Message 19 of 28 in “What are branches?”
  1. Johannes SchindelinApr 19, 2009
  2. Michael WittenApr 19, 2009
  3. Tuncer AyazApr 19, 2009
  4. Johannes SchindelinApr 19, 2009
  5. Tuncer AyazApr 19, 2009
  6. Dmitry PotapovApr 20, 2009
  7. Michael J GruberApr 20, 2009
  8. Dmitry PotapovApr 20, 2009
  9. Michael J GruberApr 20, 2009
  10. Dmitry PotapovApr 20, 2009
  11. Junio C HamanoApr 20, 2009
  12. Marius VollmerApr 20, 2009
  13. Junio C HamanoApr 21, 2009
  14. Dmitry PotapovApr 21, 2009
  15. Johannes SchindelinApr 20, 2009
  16. Björn SteinbrinkApr 20, 2009
  17. Jakub NarebskiApr 20, 2009
  18. Björn SteinbrinkApr 20, 2009
  19. Jakub NarebskiApr 24, 2009
  20. Björn SteinbrinkApr 24, 2009
  21. Dmitry PotapovApr 20, 2009
  22. Johannes SchindelinApr 20, 2009
  23. Michał KiedrowiczApr 20, 2009
  24. Dmitry PotapovApr 20, 2009
  25. Björn SteinbrinkApr 20, 2009
  26. Brian GernhardtApr 20, 2009
  27. Felipe ContrerasApr 25, 2009
  28. Michael J GruberApr 20, 2009

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.