5 points

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.

permalink
report
reply
2 points

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.

permalink
report
parent
reply
3 points

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

permalink
report
reply
1 point
*

Depends on context.

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

permalink
report
reply
1 point
*

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.

permalink
report
parent
reply

Git

!git@programming.dev

Create post

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Resources

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

Community stats

  • 1

    Monthly active users

  • 118

    Posts

  • 127

    Comments