News for hackers. Stuff that matters.
Re:Do we think of Git commits as diffs, snapshots, and/or hi... by samus on Saturday January 06, 2024 @01:38AM (#38889044)
In German (and curiosly also in Chinese) "adding" or "giving gas" is the common idiom for accellerating. Also sometimes in general for putting in more effort.

Git actually presents a very simple view to the user: repository states across time. These states can be compared to each other.

Re:Do we think of Git commits as diffs, snapshots, and/or hi... by tsimionescu on Saturday January 06, 2024 @02:15AM (#38889238)
> Git actually presents a very simple view to the user: repository states across time.

That doesn't explain commands like rebase or cherry-pick or even patch. The diff algorithm that generates diffs based on history is very much integral to git, even if it is configurable. There are plenty of git commands that assume you can meaningfully transform a commit into a diff from its parent(s). So commits are sometimes snapshots sometimes diffs, depending on the tool you're using to interact with them.

Re:Do we think of Git commits as diffs, snapshots, and/or hi... by samus on Saturday January 06, 2024 @02:47AM (#38889401)
That's true. However, that's implicit in the way these commands are defined. It has to be that way to make working with Git efficient, which is optimized for common use cases. For example, to cherry-pick a single commit.