63

As we all know:

Git gets easier once you understand branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space

Which seems like jargon, but on the other hand,

All told, a monad in X is just a monoid in the category of endofunctors of X, with product × replaced by composition of endofunctors and unit set by the identity endofunctor.

is funny because it is true.

Can I avoid merging mistakes by reading this simple text?

Larry OBrien
  • 4,927
  • 2
  • 21
  • 25
  • 9
    As a git enthusiast and someone who has a Master's in applied mathematics, I suspect the answer is "No". – joshin4colours Sep 16 '14 at 21:14
  • 1
    Sounds like someone tried to read a math book, but failed. – tp1 Sep 16 '14 at 21:34
  • 13
    I don't understand why people are voting to close on the basis that what I am asking is unclear. I am asking if the phrase I quoted is factual. (The phrase I quoted is widespread, as you can confirm with Google.) – Larry OBrien Sep 16 '14 at 22:39
  • 1
    You may find this discussion on reddit about the quote useful: http://www.reddit.com/r/programming/comments/embdf/git_complicated_of_course_not_commits_map_to/ –  Sep 17 '14 at 15:14
  • 5
    Once you've spent some time attempting to get the meaning of that sentence, Git really *might* seem comparatively easier to understand than before… – stakx Sep 17 '14 at 20:08
  • 2
    This tweet has also inspired questions [on Mathematics Stack Exchange](http://math.stackexchange.com/questions/675092/does-this-statement-about-hilbert-spaces-make-any-sense) and [on Computer Science Stack Exchange](http://cs.stackexchange.com/questions/12652/is-there-a-formal-cs-definition-of-vcs-and-file-versions). – Gilles 'SO- stop being evil' Aug 18 '15 at 18:02
  • When first reading I thought of course nice nerd like joke. The more I work with git the more often I find myself thinking "Whatever this means it must be true" :) – grenix Oct 27 '21 at 09:54

2 Answers2

80

It's a joke, that is based on the monad joke, but without actually getting the monad joke.

The monad joke is funny on three levels:

  1. it tries to explain abstract mathematical jargon with even more mathematical jargon, which is even more abstract
  2. however, the explanation is actually correct
  3. and once you dive deeper into category theory, you will actually start to see monads as "just a monoid in the category of endofunctors"

The Git thing, however, is just random gibberish. It is meant to resemble the monad joke, and might also be a jab at the darcs patch theory, but fundamentally, the person making the joke didn't understand the monad joke.

Sources:

This is the original tweet containing the quote:

Wil Shipley (‏@wilshipley): Sweet god I hate git.

Isaac Wolkerstorfer (‏@agnoster): @wilshipley git gets easier once you get the basic idea that branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space.

And this is a comment on Quora by the original author of the tweet:

To confirm what Leo said, it was intended as a joke. […]

It was intended as firmly tongue-in-cheek. I actually love git, and I think its complexity is greatly overblown. At the same time, I'm sympathetic to the fact that advice from git gurus to novices can end up sounding like inscrutable gibberish.

It's not intended to have any deeper meaning. […]

The Leo he is referring to is another answerer in the same thread, a mathematician, who basically explains why that is nonsense. (Hilbert spaces are continuous, patches and branches are discrete.)

He also explains that he was inspired by this blog post (A Guide to GIT using spatial analogies), which actually does make sense.

Jörg W Mittag
  • 101,921
  • 24
  • 218
  • 318
  • 16
    That's disappointing. – Larry OBrien Sep 16 '14 at 22:44
  • This answer is likely to be correct, but it's not currently easily verifiable. Could you add an explanation why the statement is false, or were you only *guessing* when writing this answer? I for one suspect that there might actually be an equivalence between sequences of diffs and Hilbert spaces, but this comment is too small to prove it. – amon Sep 17 '14 at 07:57
  • 6
    @amon: I added a quote by the author of that joke, wherein he explains that any sense that statement would potentially make is purely coincidental: "Attempts to analyze it in this fashion should be futile, but due to a bug in reality, you can actually make any sufficiently hand-wavy statement fit if you try hard enough." – Jörg W Mittag Sep 17 '14 at 08:21
  • 1
    +1 for discrete vs continuous reasoning to rule out why this statement is incorrect :) – joshin4colours Sep 17 '14 at 20:36
  • 11
    I've always assumed that the author of the joke did get the monad joke but was purposely descending in to gibberish as a parody. One of those things that starts out plausible and becomes steadily less so until only at the end can you be sure its gibberish. It seems uncharitable to conclude he didn't get the monad joke. – psr Sep 19 '14 at 22:56
  • 2
    You might find [this explanation git bisect](http://yarchive.net/comp/linux/git_bisect.html) useful in explaining the joke. Note the author. –  Sep 20 '14 at 13:53
  • Actually the mathematical jargon is not more abstract. (Endo)functors and monoids are rather common mathematical objects, monads are essentially unknown among mathematicians, they seem to be much more common among programmers – Andrea Aug 18 '15 at 18:30
  • 5
    This is a bit of a quibble - overall I think your explanation is great and the contrast with the monad joke is well-taken - but I never actually intended this as a mirror of the monad joke. I'm not even sure I had heard the joke at the time. It's actually (as you point out later) based off the tartley blog post. I was mainly going for gibberish - I had no intent of mirroring a "sounds like gibberish but is actually technically correct" joke. But I love the thoroughness of your answer! It's just not (as far as I can remember, of course) actually correct. – agnoster Jan 05 '17 at 10:16
  • 1
    I knew Isaac’s response was famous because I still see likes and retweets of it to this day, but I did NOT know it was gibberish or that it was THIS famous! – Wil Shipley Nov 13 '19 at 23:14
13

It's a joke, as confirmed by the author and Jörg W Mittag's answer explains in more detail.

But truth can be stranger than fiction…

There has been work of formalizing version control, in particular patch theory by David Roundy which is the basis of Darcs (a distributed version control system that preceded the more popular Bazaar, Git and Mercurial by a couple of years but never reached their popularity). The main objective of the theory is to model merging and, in particular, conflict resolution. The Darcs wiki has an introduction to the theory and a few pointers as well as a bibliography (unmaintained so outdated if you want a recent view on the subject, but it does list a 2009 survey paper by Petr Baudiš) and a list of talks (which includes more recent material). There's also a wikibook. One seminal paper is A Principled Approach to Version Control by Andres Löh, Wouter Swierstra and Daan Leijen3.

Patch theory does lead to a categorical model, which has been more recently explored in A Categorical Theory of Patches by Samuel Mimram and Cinzia Di Giusto and Homotopical Patch Theory by Carlo Angiuli, Ed Morehouse, Daniel R. Licata and Robert Harper. In Mimram and Di Giusto's work, the model has files as objects and patches as morphisms. I think that makes merging a branch a functor — an endofunctor if you're working in a single repository. “Homeomorphic endofunctor” doesn't make sense to me. And with homotopy theory involved (a concept from calculus — that's the branch of mathematics that studies things like manifolds and Hilbert spaces — which has recently been applied to a fundamental model of mathematics called homotopy type theory), submanifolds of a Hilbert space might not be so far out...