• @[email protected]
    link
    fedilink
    65 months ago

    Who we?

    I think of them as snapshots organized in a directed acyclic graph (DAG).

    Diff is only a viewing option, or an optional compression implementation detail in packed history files.

    • TechNom (nobody)
      link
      English
      25 months ago

      Diff is only a viewing option

      It isn’t. Git uses 3-way diff/merge algorithm quite liberally behind the scenes.

  • @[email protected]
    link
    fedilink
    English
    55 months ago

    Trust me, it’s a diff. I’ve seen a repo get into a very stupid state where there were changes in the main branch that weren’t in the develop branch, but a PR didn’t pick up those charges because they were somehow not in any of the commits

  • Maoo [none/use name]
    link
    fedilink
    English
    55 months ago

    Commits are snapshots with tracking that enables diffing and histories. git very specifically focuses on commits containing complete information (snapshots) instead of older diffing models that would need to sometimes replay diffs to arrive at a commit state.

    • TechNom (nobody)
      link
      English
      25 months ago

      Mercurial took an interesting approach here. It stores commits as diffs with occasional snapshots in between. This is similar to how video codecs store frames as deltas with occasional full ‘keyframes’ in between. This is the way Mercurial blunts the diff-replay problem you mentioned.

      Git AFAIK, stores each file modification as full snapshot, until it is packed at some stage. Mercurial doesn’t need this work around. Mercurial diffs are also format-neutral. It works fine with binary data.

  • @Kissaki
    link
    English
    1
    edit-2
    5 months ago

    Depends on context.

    Most of the interfacing is change based. But calling that diff is misleading.

    • TechNom (nobody)
      link
      English
      1
      edit-2
      5 months ago

      But calling that doff is misleading.

      Git actually uses diffs behind the scenes a lot - 3-way diffs/merges to be more accurate. Merging, rebasing, cherry picking and even reverting are all 3-way diff-merges.