Hacker News new | past | comments | ask | show | jobs | submit login
Paris Metro lines on a Git graph (github.com)
262 points by lelf on June 7, 2015 | hide | past | web | favorite | 36 comments

Similar idea for DC Metro here: https://github.com/bburky/git-dc-metro

Yep, that's mine.

Actually, it was you Christian, who was describing the git graphs as train tracks and prompted me to do this.

vbarbaresi, you should include the script or whatever method you used to generate the metro. I noticed you also used --allow-empty.

I will, it's a recursive Python script actually. I think the algorithm is suboptimal and a bit messy, I'll share as soon as I rewrite it.

I would like to read that article, comment whatever about git and graphs

Oh. It was an in-person conversation, or possibly a Facebook message that @bburky and I had at some point. Let me see if I can dig it up, but I think it was pretty much just a screenshot of gitk on a particularly complex graph.

(original poster here) I figured that someone might have already done it, but I didn't find these. It's surprising because I wrote an extremely similar README file!

However it looks like he wrote the solution manually, whereas I couldn't as it's way too complicated with Paris' metro system. I wrote a small algorithm (using Python) to create the graph. I'll probably publish it, after I clean the code a little.

> I wrote an extremely similar README file!

Very similar, to the point that I initially thought you had copied/plagiarized it, until I went and checked.

> I had to remove some interconnections, because there were some cycles.

Because git doesn't allow cycles? Then as cool as this is (and it's very cool), perhaps this isn't an appropriate tool for this purpose.

Or might the natural, human-built cycles be expressable as subrepositories?

> perhaps this isn't an appropriate tool for this purpose

Would Mercurial be more appropriate, or do you think DVCS are simply not an ideal way of mapping metro lines?

In response to your siblings, I think this use of git is delightful, and I don't want to take away from that. I love that people play with these tools.

As to Mercurial being better, I don't know but I doubt it.

My comment isn't even really directed at the appropriateness of DVCS specifically. It's just a general observation of using an acyclic tool to describe a network with cycles. We do that a lot, sometimes for play, sometimes for practicality, and sometimes because we just flip the fuckit bit. http://thechive.com/2009/11/11/there-i-fixed-it-23-photos/

I'm pretty sure scrollaway's comment is sarcastic :D

quite :)

Better try Source Safe :)

Mercurial is also an interface to a directed acyclic graph. If the graph is cyclic, Mercurial would also not be an appropriate tool to model it.

The object model of git is described as a directed acyclic graph, thus by definition, it has no cycles, which wouldn't make sense for a version control system anyway.

That said, this is most likely just meant as a fun visualization, because the visualization does look like a railway map.

> perhaps this isn't an appropriate tool for this purpose

Isn't the sole reason this is on HN, on the frontpage, exactly the fact that git and it's graphs aren't appropriate at all for drawing metrolines and yet somebody though of it and then did it as well?

I think the git file structure technically supports cycles, you just need to break sha-1 to do it.

I don't think the tooling is made for it either.

The low level tooling can do that. When creating a commit you can pass arbitrary parents to the command. But as you said you'd need to break sha1.

> git commit-tree <tree> [(-p <parent>)...] < changelog

.git/info/grafts allows creating cycles without having to break sha-1.

Well, you can do branches and multiple-parent merges, so as long as you don't care about directionality mapping to commits you can express the structure on connection, at least.

Very cool! Git really clicked for me when I realized it was just a set of programs for manipulating a directed graph.

Can't wait to see the pull requests:

    Pull request 1: Direct route from my flat to work

Cool stuff! I'm wondering: are there other fun things people have done with Git repositories? Things that come to mind are:

- Family trees, genealogy

- Electrical circuit schematics

- Storylines for books, movies, RPG

- Accounting, ledgers

- Jurisprudence


The gitcoin challenge in the stripe CTF was pretty cool!

Great idea (as a concept)!

But I guess finding connections and directions is a bit complicated (because after all the commits form a directed graph, as opposed to a subway map)

It seems that, apart from gitk, there are some tools built for displaying git commit graphs. http://stackoverflow.com/questions/1057564/pretty-git-branch... In terms of the final use of this I haven't digged enough yet. What seems pretty straight forward is the potential of directed graphs for dashboard graphic interfaces. If you could export the git data to JSON, it shouldn't be very difficult to implement with D3 the dinamic generation of SVG's views. This way you might have a chance of making the graph interactive. Example: you could click on a node to retrieve the complete data contained in it, highlight a branch... Otherwise the graph might end not being very usable in terms of information organization or retrieval. However I'm very much for making cool things and not caring too much about usefulness. This is already a cool thing, thanks for sharing.

This is pretty cool. Does anyone think this would work well for some network topology mapping?

42 commits. Well done :)

On master.. There are 300 stops, so you'll need at least that many commits. There's different branches for different lines.

Shouldn't that be "maître"? ;)

You can be sure it's not Imperial

If I could cache the page I wouldn't need a metro app anymore.

Attention à la marche en descendant du train!

You could do the same for Rome in no time.

Was any tooling built to help doing this?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact