On gitology – The Scribbler of the Rueful Countenance
On gitology
Written by –<br>Jordi
December 18, 2011
Our analysis of git hatred begins with a discussion of gitology, which I now define:
gitology (n. from git, a comptemptible fellow or DVCS): The pernicious study of the inner workings of git and how to apply them.
Thus gitology refers to the theoretical framework and mental model one must absorb as a prerequisite to becoming fully competent with git’s commonly-used features. Here a distinction must be made, because although there are many gitological concepts that only apply to git, many others are part of general DVCS theory. Gitology, however, sometimes interprets general DVCS concepts in its own way.
The following gitological concepts are not particular to git:
repositories (repos)
commits or changesets (csets)
directed acyclic graph (DAG)
branches
pushing and pulling changes
whole-repo tracking, not individual files
rebasing csets
pushing and pulling csets
The following are purely gitological and add unnecessary complexity, in addition to eventually being unavoidable:
Exposing the index/staging area
Exposing other implementation details: blobs, trees, commits, refs
refs and refspecs
Branches are refs
Detached HEADs (a.k.a "not on a branch")
Distinguishing remote and local tracking branches
Choosing which branch to pull onto
Bare repos
Hard, soft, mixed resets
Porcelain vs plumbing
I will say more of each in turn further down.
Unavoidable gitology
If you are a user of git, I invite you to try to describe the purely gitological concepts above. If you have used git more than casually, I am sure you probably know what most of them are. If you don’t know most of them, it is likely because you haven’t used git for very long.
It is clear that gitology is unavoidable. A user of git must quickly become a student of gitology for git will make no attempt to hide its ugly guts to said user. Consider for example one of the first tasks that a user of git will encounter, making a commit. This is how git’s manpage describes this operation (and manpage it is, in the classic style of nerd-only Unix documentation):
Stores the current contents of the index in a new commit along with a log message from the user describing the changes.
Immediately the first gitological concept pops up, the index. Now, the index is not unique to git, nor even to a DVCS. Practically every VCS must implement an index in one way or another However, it is an implementation detail, which a VCS might decide to not implement for whatever reason. The great gitological stroke of genius was to gleefully expose and moreover force the user to manually handle the index. Any other common VCS only optionally makes the user handle it. Moreover, this is touted as a frequently-loved feature of git.
Let me pause here for a moment to describe why this is characteristic of git’s pathological design choices.
The index is an implementation detail. Git refers to implementation details as "plumbing" and the user interface as "porcelain", in order to make it clear that git’s designers think of git with the same reverence I think of the instrument that handles the organic waste that my body produces. Git’s makers (I hesitate to suggest that they actually consciously designed this, so I won’t call them "designers" again) refer to the index as "porcelain", whereas it should be "plumbing", as evidenced by how it’s handled by hg, darcs, bzr, and yes, even crufty ol’ svn handles the index automatically.
They used manpages to document them. The manpage is a Unix developer format that tends to lead to terse or obscure documentation. It doesn’t have to do this (e.g. BSD tends to have great manpages), but as the name indicates, it used to be just a single page, really, just a cheat sheet with mnemonics to remind people what they already should have known about a program. The UNIX Haters’ Handbook explores this documentation problem in more detail. In this case, if you didn’t already know what an index was, the manpage is going to make it difficult for you to figure it out. For programs that are intended to be used by nerdy Unix developers only this wouldn’t be a problem; however git is primarily a tool for collaboration, very widespread collaboration, and expecting all collaborators to be nerdy Unix developers is unrealistic and hinders the very collaboration it’s supposed to encourage. They could be Windows users, they could be less technical contributors like translators or graphic artists (yes, it makes sense to put graphics under source control, even a DVCS, with some care). Manpages are inadequate for these people.
Exposing the index is frequently touted. Git encourages micro-management, and git’s users end up loving this micro-management (and blog about it, and write books, and have conferences, and so on ad nauseam). This is characteristic of the perversion that git promotes, focussing on details instead of getting work done. Of...