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

Re: master^ is not a local branch -- huh?!?

From
RGRon Garret <ron1@flownet.com>
Date
Feb 2, 2010, 22:04 UTC
Message-ID
<ron1-9204BD.14042202022010@news.gmane.org>
In-Reply-To
<20100202191942.GB9628@fieldses.org>
In article <20100202191942.GB9628@fieldses.org>,
 "J. Bruce Fields" <bfields@fieldses.org> wrote:
Show 53 quoted lines
> On Mon, Feb 01, 2010 at 05:12:42PM -0800, Ron Garret wrote:
> > In article <7vk4uwmp95.fsf@alter.siamese.dyndns.org>,
> >  Junio C Hamano <gitster@pobox.com> wrote:
> > 
> > > Ron Garret <ron1@flownet.com> writes:
> > > 
> > > > The manual specifically contradicts you, so either you are wrong or the 
> > > > manual is wrong.
> > > 
> > > In case you haven't noticed, Pasky is one of the old timers and he knows 
> > > a
> > > thing or two about the git's world model.
> > 
> > My intent was not to diss Pasky, it was just to point out a disconnect 
> > between what he was saying and what the manual says.  It's quite 
> > possible that the manual is wrong or out of date or just misleading.  
> > But it says what it says.
> > 
> > > And I do not see a contradiction in what the manual describes and "a
> > > branch is a named pointer to a commit" (although "named" can probably be
> > > omitted as "unnamed pointer" is not useful at the UI level).
> > 
> > But that's not what the manual says.  The manual says, "When we need to 
> > be precise, we will use the word "branch" to mean a line of 
> > development..."  Those are the first words in the section entitled 
> > "Understanding history: What is a branch?"  It certainly appears to the 
> > untrained eye that that is intended to be the definition of a branch.
> 
> My memory is that I'd seen the word "branch" used for both meanings (a
> linear piece of history, and a ref under ref/heads/), so figured we
> needed terms for both.
> 
> But then I didn't really use that distinction anywhere.  On a quick skim
> the only instance I can see of the first sense is in
> http://kernel.org/pub/software/scm/git-core/docs/user-manual.html#counting-com
> mits-on-a-branch,
> which could probably be reworded.
> 
> It still may be worth acknowledging the confusion; e.g., something like:
> 
> 	In the above diagram, "A", "B", and "master" are all references
> 	to a point in history.  We call all three "branches".
> 
> 	Informally, the word "branch" is sometimes also used to the
> 	entire line of development leading up to one of these points,
> 	or, more generally, to any individual line of development.  But
> 	when speaking about git, a "branch" (or "branch head") will
> 	always be a reference to a point in history, and in particular a
> 	reference which may be advanced to new commits by future
> 	development.
> 
> Eh, I don't know if that's helpful; maybe that section could just be
> deleted.  Or replaced by a more general discusion of the ref/ namespace.

FWIW, I find the above verbiage to to be very clear, much better than what is there now. You might also add that branches are almost exactly the same as tags. The only difference (AFAIK) is that tags get dragged along by commits and resets and tags don't.

rg
Previous: J. Bruce FieldsNext: J. Bruce Fields
Message 14 of 24 in “Re: master^ is not a local branch -- huh?!?”
  1. Steve DiverFeb 1, 2010
  2. Junio C HamanoFeb 1, 2010
  3. Sergei OrganovFeb 1, 2010
  4. Ron GarretFeb 1, 2010
  5. Petr BaudisFeb 1, 2010
  6. Nicolas PitreFeb 1, 2010
  7. Junio C HamanoFeb 1, 2010
  8. Ron GarretFeb 1, 2010
  9. Petr BaudisFeb 2, 2010
  10. Ron GarretFeb 2, 2010
  11. Junio C HamanoFeb 2, 2010
  12. Ron GarretFeb 2, 2010
  13. J. Bruce FieldsFeb 2, 2010
  14. Ron GarretFeb 2, 2010
  15. J. Bruce FieldsFeb 3, 2010
  16. Nicolas PitreFeb 2, 2010
  17. Ron GarretFeb 2, 2010
  18. Nicolas PitreFeb 2, 2010
  19. tytso@mit.eduFeb 2, 2010
  20. Junio C HamanoFeb 2, 2010
  21. Junio C HamanoFeb 2, 2010
  22. Nicolas PitreFeb 1, 2010
  23. Jay SoffianFeb 1, 2010
  24. Steve DiverFeb 1, 2010

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.