Skip to content

gjhenrique/metro-clojure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI

Motivation

A few years ago, I saw a repo called MetroGit. This repo is, in fact, a git graph taken from the Paris metro map. Each commit is a station, and when two or more connections meet, it creates a merge.

I was trying to learn Clojure, and I thought: "Why don't I build something based on that idea?!?!" So, that's when metro-clojure was born.

This repo takes a generic metro map as a JSON input, builds a DAG and traverses that graph generating the correct git commands.

Generate git commands

# São Paulo
# Takes the map from res/sp.json and generates sp.sh
boot generate-git-commands -c sp -f sp.sh

# New York City
# Takes the map from res/nyc.json and generates nyc.sh
boot generate-git-commands -c nyc -f nyc.sh

# Tokyo (Thanks to https://github.com/akky)
# Takes the map from res/tokyo.json and generates tokyo.sh
boot generate-git-commands -c tokyo -f tokyo.sh

Viewing the metro graph

# Open graphviz graph
boot view-graph -c sp

Generate the clojurescript files

# Visit http://localhost:3000 to check an animation of the traversal
boot dev

# Optimized js file with the animations
boot prod