TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why I Don't Hate Git: Hidden Consistency

157 pointsby kozlovskyover 10 years ago

10 comments

jordighover 10 years ago
(copied over from lobsters, with links to more material there: <a href="https://lobste.rs/s/odj5y1/why_i_don_t_hate_git_hidden_consistency/comments/dtlwwf#c_dtlwwf" rel="nofollow">https:&#x2F;&#x2F;lobste.rs&#x2F;s&#x2F;odj5y1&#x2F;why_i_don_t_hate_git_hidden_consi...</a> )<p>Haha, I spurred this debate with mitsuhiko over IRC yesterday. I was arguing with him over git vs hg yesterday, and this blog post is obviously his retort. Here is my defence of Mercurial:<p>Mercurial’s design aims to welcome people who come from other VCSes. It started being welcoming to CVS and SVN users, and its CLI mimicked those, as well, as a few ideas of Bitkeeper. Git’s initial design was very bitkeeper-like too, such as branching-by-cloning being the only way to branch. Nowadays, Mercurial also makes some concessions to git users.<p>Despite its various sources of inspiration, Mercurial works hard to keep all of these ideas consistent. Commands rarely grow new options. Many deviations from core functionality are first tested in optional extensions for a long time before going into the core. Lots of time is spent bikeshedding what a command’s name should be, and what language the documentation should use. Consistency is very important. Backwards compatibility is tantamount. The CLI is the UI and the API.<p>A thing git is often lauded for is the simplicity of its internals, which are frequently deemed to be as simple as to not be internal at all. Despite being a binary format, Mercurial’s revlogs are also approximately simple, which is why people sometimes write parsers in other languages.<p>But Mercurial is a lot more than just git-with-a-nicer-UI. There are many exciting features in Mercurial, features that I don’t think will ever make it into git because they are just too different from the way git works. Mercurial Evolve really changes the way we collaboratively edit commits. Templates and revsets can be combined to program interesting extensions. New extensions can scale Mercurial into gigantic repos.<p>And because I think these ideas are so great and must be explored and improved, I will keep using Mercurial, teaching Mercurial, and improving Mercurial
评论 #9066186 未加载
评论 #9065917 未加载
krupanover 10 years ago
Basically this says, &quot;git&#x27;s UI was so bad that it forced me to learn the internals, and once I groked the internals git made a whole lot of sense.&quot; That summary might sound like I&#x27;m trolling but I don&#x27;t think that&#x27;s a bad thing (else, why is git so popular?). I&#x27;ve been the mercurial &quot;expert&quot; on my team at work for the past 5 years and I can&#x27;t count the number of little DAG diagrams I&#x27;ve drawn trying to get people to understand what was <i>really</i> going on with their repository. I&#x27;m pretty sure there are a few people who still don&#x27;t really understand how mercurial works under the hood. Maybe that&#x27;s a positive aspect of mercurial...but maybe it&#x27;s not :-)<p>Now, I will say that the internals of mercurial that you need to understand to gain enlightenment seem simpler to me than what you have to know for git. Mercurial has commits and commits have parent reference(s) that link commits together into a DAG. Commits might have a branch label. You move commits from one repo to another with push and pull. You create a commit with two parents by doing a merge. And that&#x27;s it!<p>Git has those same basic concepts, but you also have to know about the index, and branches (which are really pointers to commits that may or may not be a branch in the DAG), and remote branches, and merges that aren&#x27;t really merges because they just move the branch (which is a pointer, remember, that&#x27;s why a &quot;branch&quot; can move) to the head, and all kinds of other interesting (and useful, no doubt) concepts.
fskover 10 years ago
Three words against git: Detached Head State<p>I view git as a sort of shibboleth.<p>You can&#x27;t really understand how git works unless you understand trees as a data structure. That excludes all but the hardcore types.<p>Some designers and CSS experts need to use source control, but Git is too complicated for them.<p>Once you get a detached head state or corrupted repo, then you need a git expert to clean things up. I once committed while in a detached head state, and so git ate my changes and I had to reflog to recover them. That is just insulting.<p>At my job, I work with some designers now, and they always leave the test server in a detached head state.<p>But when I switched from the GitHub client (yuck) to the SourceTree client, most of my concerns went away.
评论 #9066732 未加载
评论 #9066645 未加载
scrollawayover 10 years ago
Good article. That old tutorial is scary :)<p>&gt; I screwed up really badly before, merging wrong things together, accidentally deleting data and much more, yet I never lost any data or felt left abandoned by my tool.<p>I can relate for the most part. I can only think of one instance (in over half a decade) where I felt git&#x27;s shortcomings: there is no way to get a deleted non-gc&#x27;d object from a remote to your local repository, even if you try to reference it by its sha1.<p>This happened to me when some bad changes were force-pushed to a repository on Github and did not have access to a machine which had the latest changes. My repository on Github still knew about the old commits, but they were unreachable by git itself.
评论 #9064332 未加载
评论 #9066281 未加载
评论 #9065097 未加载
akkartikover 10 years ago
Do others have examples of software &quot;where the way it works is a crucial part of the user experience&quot;? The one that comes to my mind is lisp macros; if you mess with them for a month or two you can&#x27;t help but have a pretty good understanding of how they work. Clean internals can colonize your brain in a way that merely clean interfaces can never compete with.
评论 #9065372 未加载
melloclelloover 10 years ago
This article begs the question - what might a sane&#x2F;consistent UI on top of git look like?
评论 #9066811 未加载
评论 #9064504 未加载
评论 #9065312 未加载
评论 #9065807 未加载
评论 #9064380 未加载
评论 #9064751 未加载
评论 #9067461 未加载
zallarakover 10 years ago
The conceptual model matches the implementation - this is what Don Norman&#x27;s &quot;Design of Everyday Things&quot; says is good design. When this is the case, a user can interact with the object&#x27;s interface using logic and intuition and get predictable results.<p>I agree, git really embodies this.
评论 #9065373 未加载
wcummingsover 10 years ago
Having grown up w&#x2F; git (svn was on the way out when I started programming) and then having had to use svn at a previous employer (I migrated it to git, eventually), I can&#x27;t fathom a reason to prefer svn or to &quot;hate&quot; git other than ignorance.<p>You can spot an ex-svn user from a mile away by their commit history. We need rehabilitation clinics.
评论 #9065430 未加载
评论 #9067138 未加载
评论 #9066832 未加载
serve_yayover 10 years ago
I am getting a message when I push stuff to Github (or any remote) because there is a git config value that I need to set. I just did a search to try to understand the effect of each option for this value, so I could pick the one that best fits how I want git to act. I am approximately 90% sure I understand what each one does, however all of the explanations of them have some element of confusion or lack of clarity. This is the problem of using git.
评论 #9066894 未加载
zemover 10 years ago
tangentially, that&#x27;s a really lovely header font (&quot;jim nightshade&quot;). one of the very few times i&#x27;ve seen a &quot;fancy&quot; font work well in a post like this.