4 ms·
Git is great for keeping track of logical history, but personally I find that it is missing tools for handling physical history. Reflog is a step in the right d
by PhilipRoman 3y ago
Git is great for keeping track of logical history, but personally I find that it is missing tools for handling physical history. Reflog is a step in the right direction but it has a limited size and AFAIK it is not possible to share a reflog between clones. Which leaves "cp -r repo repo.backup" as the best option.
Of course, as long as you only do additive changes via commit/merge/revert, the logical history is equivalent to the physical history, but commands like rebase break this model. And despite the flaws of rebase workflows, sometimes it is the best option, like when maintaining a fork.
To my surprise Vim actually has something like this - logical history with undo/redo and physical history with g+/g-/:earlier/:later
Another thing I would like is some way to "fold" multiple small commits into one bigger one (for display purposes only) as it would let me split large diffs into minimal, self-contained commits while maintaining a reasonable git history.
- ysofunny 3y agowhat's the difference between physical history and the logical one? thanks in advance
- PhilipRoman 3y agoThe simple explanation: Logical history - what you see when you do "git log --all". Physical history - doing "git log --all" every time a repository updates and then storing each output as an entry into another history log. Kind of a "history of histories" The complex explanation: a git repository at a particular time consists (mostly) of a graph of commits. This graph represents the logical history of code changes in the repository. The graph can be updated in an append-only fashion (using commit/merge/revert) or in a destructive way like with rebase and reset. The physical history is simply the history of the graph over time.
- ysofunny 3y agoin other words the history of the graph is the physical history and the logical history is the filesets which are the nodes in the graph which is the branching sequence of commits the issue is that the 'logical history' is the reason git was built and the 'physical history', seems to me, is only feasible because we have the regular git sequence of commits