Git Koans (2013)
stevelosh.com
stevelosh.com
Git's rise to become the de facto standard revision control system has been fascinating to watch.
I think it does provided real benefit over Subversion, but there are also smaller projects where the gain is marginal.
The tooling around (in particular GitHub) and perception that git is the "right" way to do things probably helped it achieve prominence. As well as early adoption by a few high profile projects.
That being said, most complaints about Git are of its difficulty for newcomers, non straightforward workflow, and lack of clear, concise documentation. Once the concept is reasonably grok'ed, one would likely be hard pressed to find a developer who prefers a centralized system such as SVN over Git.
Are we talking about the same Git? Its command line interface is quite straight forward and very simple to use to perform the usual everyday tasks.
Can you actually point out a single example of what you perceive as a "landfill fire"?
I mean, that's pretty much how all version control systems operate. Is it that hard to wrap anyone's head around the basic functionality that is common to any version control system in use?
I get that you like Git's UI, or at least don't mind it. That's fine. Others feel differently. That's fine too.
git rev-parse --abbrev-ref HEADTry randomly slapping your hands on a keyboard and writing software in <insert language>. Now complain that because you can't do that, <insert language> sucks. That's basically how I see these types of complaints about git.
These koans point out how the UX of Git often makes it harder (than necessary) to learn.
> try randomly slapping your hands on a keyboard [...] you can't do that
Well it worked when they chose all those command line arugment letters... </s>
"Subversion has no internal concept of a branch—it knows only how to make copies"
Now even if I do not need distributed features of git, I have VCS with local repo with git and I have easy branching. So even if I work on my side project I use branching a lot because I can do cheap experiment branches, go back to previous state or pick what I liked in my experiment. For me it is just totally different approach to development. When I stopped using Subversion and started using GIT my world changed for better, GIT gives me more control. I can pick parts of files to be staged or pick what I need to be commited. Where partial commits with subversion is at least black magic.
So even for smaller projects it is like a whole world of difference for using GIT.
I think that kinda implicitly means the author considers git to be either paradoxical or illogical. That seems even more clear from the last two paragraphs of "The Hobgoblin".
If that's the case, the "One Thing Well" kohan misses the mark rather glaringly.
For example:
> [something about history being present and immutable]
>“Splendid!” exclaimed the historian. “I have a historical record of a merge commit with two parents. How can I find out which branch each parent was originally made on?”
>“History is ephemeral,” replied Master Git, “the knowledge you seek can be answered only by the gods.”
the pedantic explanation here is that branches are a separate subsystem, with each branch just being a pointer to a commit. And the history works off of the commit.
The answer from "Master Git" doesn't feel like an answer from a master. Maybe I'm reading too much into this but Git becomes way less confusing if you think more about what things are, rather than how they're used .
at that moment, positr0n was enlightened
It's my favorite way to learn the syntax for a new language.
Also, should the checkout one be enlightening? I never thought about it, despite using git every day, but overloading git checkout like that seems like it should be confusing.
> To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored.
(any other good examples of things like this?)
And if the branch has been deleted, which typically happens after merging, then there's not much reason to know the branch name.
Is there something I'm missing here?
Most likely the branch names give you a good deal of information in working out why things have happened.
(assuming a non-fast-forward commit, where the branch is not really a branch because nothing happens in parallel)
I believe mercurial does this by default. Why not give it a try?
I would add a third example, deleting a remote branch, which (at least as of 2013) is
git push <remote name> :<branch name>
Neither `-d` nor `rm`!https://github.com/git/git/blob/master/Documentation/RelNote...
git push $remote $local_commit:$remote_branch
which updates the remote ref $remote_branch so that it points to $local_commit; here it updates the remote ref so that it points to nothing (which means deleting it). Sure, this is inconsistent with other git commands, but it's not completely illogical. Though I'd probably prefer something like git push $remote $remote_branch=$local_commit
where the '=' makes you think of assignment, hinting at what this command actually does.Most other complaints about git I've seen seem to be of the vague 'but git is sooooo confusing' sort, which just invites people to talk past each other.