• notabot@lemm.ee
      link
      fedilink
      arrow-up
      8
      arrow-down
      1
      ·
      29 days ago

      Git branches are very different to Mercurial branches. In git they’re similar to tags that move along with the head commit of that particular branch. In Mercurial every commit contains meta data indicating the branch it’s on. It also has a query language that lets you do sone quite neat things with selecting groups of commits based on their metadata, which can be useful in code reviews and similar.

      • SpaceNoodle@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        29 days ago

        That just sounds like an implementation detail.

        Can you provide an example of something that’s possible in Mercurial, but not git?

        • notabot@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          29 days ago

          Most of the time you’re right, it’s little more than a detail, but sometimes I miss the querying that it allowed. You could ask for things like a list of all branches that branched from a specific parent branch and modified a specific file, Which can be handy when you want to understand the impact a change might have before you make it and try merging.

          Having the branch name embedded in the commit means you can meaningfully ask this sort of question. In git’s model you can’t say a changeset is in a specific branch once there are child branches further downstream because the changeset is in all of those branches.

          Rather than come up with lots of examples for other queries (I know it wasn’t the focus of your question, but I think it’s really neat), I found this page which seems like a reasonable description.

    • alsimoneau@lemmy.ca
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      29 days ago

      No, git has labels on heads of branches. Once the head moves you loose the information. It also makes for a more messy history, which I believe created the whole “rebase everything” philosophy to cope.