• lemmyvore@feddit.nl
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    1 year ago

    I really wish they hadn’t inherited some terms, like branch, when they made git. They used it because it was an established term going back to the ancient history of source control but it creates so much confusion. Should have been “labels”.

    I know that “branch” helps intuitively and visually when it’s actually an offshoot with one root and a dangling tip, like an actual tree branch… but the analogy fails horribly when they also use “branch” for all the labels in the middle of the bush, that aren’t free dangling offshoots. At the very least they should have reserved “branch” for those type of offshoots and use “labels” for the actual names. And say things like “that’s a branch with a label on top” or “that’s not a branch anymore, I tied it back”.

    It doesn’t help that the git history is not a tree, it’s a directional graph.

    • lysdexic@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      They used it because it was an established term

      My graph theory is a bit fuzzy but I think that the definition of a branch in a directed graph corresponds to the path between two nodes/vertices. This means that by definition any path from the root node to any vertex is itself a branch.

      I don’t think Git invented this concept, nor did any other version control system.

      I know that “branch” helps intuitively and visually when it’s actually an offshoot with one root and a dangling tip, like an actual tree branch…

      I think that your personal definition of a branch doesn’t correspond to what graph theory calls a branch. Anyone please correct me if I’m wrong.

      • lemmyvore@feddit.nl
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        11 months ago

        My graph theory is a bit fuzzy but I think that the definition of a branch in a directed graph corresponds to the path between two nodes/vertices.

        No, it’s a subtree of a DAG (directed acyclic graph). The technical term is arborescence but people who can’t spell it say branch instead.

        Technically it should have at least 2 children to be called a branch, and it can’t connect back to the graph or it’s not a subtree anymore. So it fits what most people intuitively think a (real) tree branch should look like.

        I don’t think Git invented this concept, nor did any other version control system.

        They didn’t, but Git went too far by calling any node with a label a “branch” regardless if it’s in the middle of the DAG. It doesn’t fit graph theory and it doesn’t fit the intuitive image either.

        Edit: Also, most of the source control systems that preceded Git were very rudimentary, they branch merging was either deficient or non-existent so most of them only used subtrees which never tied back to trunk. So for them “branch” was appropriate most of the time.