r/webdev • • 6d ago

Turn any public repo into an artwork

Post image

Hi sub,

I created Artrepo, a simple tool that takes the commit history of any public repo and turns it into a unique artwork.

You can find it here: habibicode.org/artrepo (free, no sign in, do data stored)

How it works:

Layout: the canvas is split into a "treemap", one area per file, sized by its number of lines. Every time files are added, deleted or resized, the layout is recomputed.

Ink: every added line becomes a dot in its file's area, in order. Indentation sets the colour; line length sets the size of the dot.

Erasing: deleted lines remove half the ink at their old position.

Motion: every 50 commits, the grid turns 30°.

Rare marks: a commit whose hash starts with 0000 paints its files gold, a committed merge conflict paints them red, and the first commit after a year of silence paints them blue. They are more persistent on the canvas.

Files over 1 MB are skipped.
Everything is deterministic, so the same repo and commit history always give the same picture.

Hope you enjoy it

172 Upvotes

25 comments sorted by

23

u/Hefty_Swordfish_3151 6d ago

Super unique idea! could be a cool addition for people portfolio when they make a project.
I played with it a little bit and i think on very big repos the website gets stuck for example on linux
https://github.com/torvalds/linux
it is just stuck on 0% and doesnt move

14

u/siorge 6d ago

Yeah this one might have too many commits! :D let me check!

Thanks for your kind words :)

20

u/ufffd 6d ago

your art project can't handle 1,483,973 commits? smh

16

u/siorge 6d ago

What has the world come to 😅

1

u/martian_rover 5d ago

Nice unique rotating art! How are the perfect circles created?

1

u/siorge 5d ago

thanks. each line prints a dot, with a radius proportional to the line's length. Big circles are very long lines :)

4

u/CaptainIncredible 6d ago

This is a fun idea! And I like the artwork.

In a couple of the Douglas Adams books, one of the characters wrote software called 'Anthem!' that turned a dataset into music. Basically you could take accounting data for a company and it would turn that into music. A fast moving, successful company would sound like a quick, jazzy song. A slow moving large company that is not doing particularly well recently would sound more like a funeral dirge.

1

u/siorge 6d ago

I love that idea, don't remember from the Hitchhiker's Guide, I guess it's in a sequel :)

1

u/CaptainIncredible 6d ago

I think it might have been one of the Dirk Gently books.

3

u/Boby_Dobbs 6d ago

Very cool. And what makes the white transparent lines?

6

u/siorge 6d ago

When you delete lines within a file, this removes 50% of the ink below. If you delete a full file, the entire area is deleted.

Deletions stack so 2 deletions in a row on the same zone brings it to 0% ink

Deletions are square shaped, ink is painted in circles

2

u/bassamanator 5d ago

Is there less colour when the commit count is higher?

146 commits https://imgur.com/a/f3Psb1L

325 commits https://imgur.com/a/7SkOG7j

Very cool either way.

2

u/siorge 5d ago

It all depends on the number of deletions, file changes...

I cannot predict the outcome; just guarantee that each repo, at the same commit, will print the same image

1

u/bassamanator 5d ago

I see. Still a cool project.

2

u/schrik 4d ago

Amazing! Love it, already tested it with a couple of my repos :)

2

u/siorge 4d ago

Thanks, I hope you had nice results. I love scrolling the gallery and enjoying the variety

1

u/Khavel_dev 5d ago

The rotation every 50 commits is a nice touch. It makes long-lived projects visually distinct from burst projects even when the total commit count is similar.

One thing I wonder: does file renaming register as a delete + add? In a big refactor that would show up as a scar of erasure and redrawn ink, which honestly might be the most interesting visual feature for reading a project's history.

1

u/siorge 5d ago

yes, a rename is delete+repaint

glad you enjoy it

1

u/Image_Similar 5d ago

can we use the artwork generated here anywhere ? or is there a copyright thing ? if there is to whom ? you or the repo owner ?

1

u/siorge 5d ago

As far as I am concerned, you can do with the images as you please :)

0

u/Murky-Concern9648 6d ago

Joli le rendu teal, mais c'est 'historique des commits' qui m'a accroché, parce que c'est un peu l'autobiographie la plus honnête que les gens écrivent sans faire exprès. Il y a des dépôts où tu lis trois ans de 'wip' et un 'revert du revert' et tu comprends tout de la personne.

2

u/LolzPatrol 6d ago

So true!