• @[email protected]
      link
      fedilink
      43 months 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.

        • @[email protected]
          link
          fedilink
          English
          3
          edit-2
          3 months ago

          If I hand you a commit, you cannot tell which ‘branch’ it is on without searching the git history and hoping that you only get one answer. That’s a bummer if, for instance, you’re a github action and only get handed the commit. If it’s on the master branch, I want to do different things than if it’s a dev branch.

          • @[email protected]
            link
            fedilink
            33 months ago

            A commit all by itself doesn’t mean as much without context.

            Why would I not want to be able to apply a commit to any arbitrary branch?

            Also, GitHub is not git - it’s based on git. Any shortcomings it may have aren’t necessarily due to a flaw in git.

            • @[email protected]
              link
              fedilink
              English
              1
              edit-2
              3 months ago

              A commit all by itself doesn’t mean as much without context.

              Luckily a commit points to its parent, which means the context is inherently present. What’s your point?

              Why would I not want to be able to apply a commit to any arbitrary branch?

              Nobody said that.

              Any shortcomings it may have aren’t necessarily due to a flaw in git.

              True enough.

    • @[email protected]
      link
      fedilink
      83 months 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.

      • @[email protected]
        link
        fedilink
        33 months ago

        That just sounds like an implementation detail.

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

        • @[email protected]
          link
          fedilink
          23 months ago

          I’ve never used Mercurial, but a simple one based on the explanations and my experience with Git:

          Locating the branch a commit originated from. If a git branch has been merged into (or rebased on) main or another branch, there’s no way to tell which commit came from which branch. But sometimes I’d really like that information to figure out what prompted a certain change. Without it, I need to use external tools like a ticketing system and hope the other developers added in the necessary information.

          • @[email protected]
            link
            fedilink
            1
            edit-2
            3 months ago

            That seems to be the opposite of useful if a commit is initially pushed to a development branch, which is relatively standard practice; now you’re polluting the tree with data that’s purposefully ephemeral, and even potentially leaking internal information.

            Also, I’d argue that such deep details do belong in another tool, rather than asking the source control tool perform triple duty by being a CR and issue tracker as well.