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

Re: Branches & directories

From
Michael Witten <mfwitten@gmail.com>
Date
Aug 18, 2011, 17:49 UTC
Message-ID
<CAMOZ1Btmk86vmp1gRuCfG7yRuc6fD3_oYBvtq2VKK9Ywu8ay0A@mail.gmail.com>
In-Reply-To
<4E4CEFDA.9000703@drmicha.warpmail.net>

On Thu, Aug 18, 2011 at 10:56, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 11 quoted lines
> Michael Witten venit, vidit, dixit 18.08.2011 07:52:
>> On Wed, Aug 17, 2011 at 21:23, Hilco Wijbenga <hilco.wijbenga@gmail.com> wrote:
>>> It would be really nice, though, if Git could somehow
>>> "stash" such files when checking out a different branch. In general, I
>>> would prefer if uncommitted changes and untracked and/or ignored files
>>> stuck to the branch where they were created.
>>
>> As an aside, the problem here is likely a manifestation of the fact
>> that nobody understands what a branch is; the word 'branch' is
>
> I would reject "nobody"...

Is it really necessary to attack something that is obviously hyperbolic rhetoric? The point is that a lot of people struggle with git's concepts, and I think that the reason is largely two fold:

  * Terminology that is inaccurate by virtue of terminological baggage.
  * Terminology that is imprecisely used across the documentation.
Show 5 quoted lines
>> TERRIBLE, as everyone has a different idea for what that should mean.
>
> ... and insist that this statement is true either trivially true for all
> words, or for none, depending on your understanding of "everyone has a
> different".
So, precision is impossible?

The word 'branch' is clearly a sticking point, and you know it. You can't deny that people have a hard time with what a branch really is in git.

>> In my opinion, `git branch' should become `git ref' or the like.
>
> "branch" and "tag" are boths refs. Their only essential difference is
> that one "moves" and the other doesn't.

Indeed, and it seems like there's room for abstraction; a tool like `git ref' or `git pointer' or `git ptr' could probably handle both quite well.

Terminology for references is a problem that was solved by the Ancients, so it's a wonder we didn't use their work (pointers, constant pointers, dereferencing, etc.).

Show 6 quoted lines
>> One of git's worst faults is that a complicated and imprecise
>> interface has been draped over a very simple and precise underlying
>> structure.
>
> A name is a name and just that. The use of any existing word may clash
> with someone's expectations.

Yeah? So why wasn't the term 'foobar' used instead of 'branch'? Most terms are chosen for their associations (and only really novel concepts receive an entirely new label), and I proffer that 'branch' has too many associations to be considered accurate enough.

The idea was that one line of development can 'branch' off from another, so it was called a 'branch'. But what is a line of development? (merges certainly make the concept fuzzy; tree branches usually don't join with the tree trunk again). The thing is, though, when you're working with what git calls a 'branch', you're really just working with a pointer to a commit object; the term 'pointer' would have been much more accurate.

Now, I'm not saying we should be using 'pointer', but what I am saying is that it's necessary to choose words carefully, preferably in a way that carries just enough associations to aid the user in remembering what a term describes.

> I find the concepts "file created on a branch", "commit created on a
> branch" silly, it's part of what drove me from hg to git early on.

There's no shortage of that kind of thinking in the git community, which is my point. The reason is a failure of both accurate terminology and precise usage.

> git's branches do exactly what I (and many others) expect branches
> to do and what I need daily, even coming from a svn and hg background.

Yes, well, many figure it out EVENTUALLY; it just requires them to ignore most of the associations of 'branch', thereby tacitly translating the word 'branch' into 'pointer'.

Previous: Michael J GruberNext: Jonathan Nieder
Message 9 of 52 in “Branches & directories”
  1. Hilco WijbengaAug 17, 2011
  2. Evan ShelhamerAug 17, 2011
  3. Junio C HamanoAug 17, 2011
  4. Hilco WijbengaAug 17, 2011
  5. Jonathan NiederAug 18, 2011
  6. Hilco WijbengaAug 21, 2011
  7. Michael WittenAug 18, 2011
  8. Michael J GruberAug 18, 2011
  9. Michael WittenAug 18, 2011
  10. Jonathan NiederAug 19, 2011
  11. Hilco WijbengaAug 21, 2011
  12. Michael WittenAug 21, 2011
  13. Hilco WijbengaAug 21, 2011
  14. Michael WittenAug 21, 2011
  15. Hilco WijbengaAug 21, 2011
  16. Michael WittenAug 22, 2011
  17. Hilco WijbengaAug 22, 2011
  18. Hilco WijbengaAug 22, 2011
  19. Michael WittenAug 22, 2011
  20. Hilco WijbengaAug 22, 2011
  21. Kyle MoffettAug 22, 2011
  22. Hilco WijbengaAug 22, 2011
  23. Kyle MoffettAug 22, 2011
  24. Hilco WijbengaAug 22, 2011
  25. Kyle MoffettAug 22, 2011
  26. Hilco WijbengaAug 22, 2011
  27. Restoring timestamps (Re: Branches & directories)Jonathan Nieder, Aug 22, 2011
  28. Hilco WijbengaAug 22, 2011
  29. Jonathan NiederAug 22, 2011
  30. Hilco WijbengaAug 23, 2011
  31. Hilco WijbengaAug 23, 2011
  32. Enrico WeigeltOct 2, 2011
  33. Hilco WijbengaOct 2, 2011
  34. Michael WittenAug 23, 2011
  35. Robin RosenbergOct 2, 2011
  36. Ronan KeryellOct 2, 2011
  37. Matthieu MoyOct 2, 2011
  38. Hilco WijbengaOct 2, 2011
  39. Hilco WijbengaOct 2, 2011
  40. Jeff KingOct 3, 2011
  41. Hilco WijbengaOct 3, 2011
  42. Jeff KingOct 3, 2011
  43. Matthieu MoyOct 3, 2011
  44. Jeff KingOct 3, 2011
  45. Matthieu MoyOct 3, 2011
  46. Jeff KingOct 3, 2011
  47. Junio C HamanoOct 3, 2011
  48. Jeff KingOct 3, 2011
  49. Hilco WijbengaOct 3, 2011
  50. Robin RosenbergOct 3, 2011
  51. Hilco WijbengaOct 3, 2011
  52. Hilco WijbengaOct 2, 2011

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.