4 ms·
The git model has fundamental limitations because it saves snapshots rather than changes, and doesn't capture some metadata changes like renames. A tool like D
by bryanlarsen 3y ago
The git model has fundamental limitations because it saves snapshots rather than changes, and doesn't capture some metadata changes like renames. A tool like Darcs or one of its spiritual descendants will have fewer merge conflicts than git.
Totally agree on your main point though. The benefits of switching are far lower than the costs.
- tehbeard 3y ago> ..because it saves snapshots rather than changes.. I might be misremembering the technical details, but isn't that only the case in a git repo with zero pack files? Will grant that the lack of metadata on renames can be issue when a file is heavily refactored alongside it's relocation.
- bryanlarsen 3y agohttps://en.m.wikibooks.org/wiki/Understanding_Darcs/Patch_theory https://en.m.wikibooks.org/wiki/Understanding_Darcs/Patch_th...
- mikewarot 3y ago>it saves snapshots rather than changes Once you understand this, GIT makes a whole lot more sense. The trouble with failed merges is an artifact of trying to appear like it tracks deltas. Merge conflicts when you're the only programmer on a product (but have multiple computers) are maddening. I blew away .git and everything in it, restarting a repository, more than once because I couldn't resolve a merge conflict, before I learned that simple fact. I've got from .zip files of my source code on floppy disks, to SVN, then Mercurial, and finally GIT. GIT is amazing, though the UI is a pain, as most agree.
- rendall 3y ago> doesn't capture some metadata changes like renames If you rename the file using git and that is the only change in your file, then it works: git mv oldfile newfile Commit that change and the rename is in your history.
- blibble 3y agothe rename won't be in your history because the tree and commit objects don't support renames the tooling infers a rename based on the lack of a content change
- trevyn 3y agoIs there a difference?
- phyzome 3y agoAbsolutely. In a move-and-edit situation, git will sometimes infer a rename and sometimes not, based on your local version of git, your settings, and the details of the edit. If inference fails, you may have a harder time resolving merge conflicts, performing cherry-picks, etc.
- dafelst 3y agoAbsolutely, the inference is based on a set of heuristics and is often just plain wrong.
- rendall 3y agoI've had one or two really annoying merges that were complicated by these renames. TIL thanks to these responses that it's not actually a rename.
- kevincox 3y agoNot only merge conflicts I find that this causes trouble if you need to manage multiple branches. Generally you see patterns like 1. Create patch 2. Merge to main branch 3. Backport a cherry pick. But there is no machine-readable metadata that the commit is the same in both cases. In simple cases you can work around this by basing the patch off of the merge base but if there are conflicts that doesn't work well. The result of this is that these two different but logically identically commits will cause future merge conflicts and make questions like "does this branch have this patch" much more difficult to answer. This is something that I think https://pijul.org/ https://pijul.org/ does quite well. Their base unit is a patch and that can be applied to multiple places. You can also have snapshots which are logically a collection of patches.
- gitaarik 3y agoDon't the snapshots make it much faster than without?