• Stars
    star
    153
  • Rank 243,368 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created 12 months ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

git commit folders

Gives you a folder for every commit in your git repository.

Extremely experimental software with lots of bugs but it works for me and I've found it a tiny bit useful.

how to use it

go build
./git-commit-folders -type nfs -mountpoint /tmp/mntdir

It'll mount a /tmp/mntdir directory with all your commits in it, then in another terminal tab you can run:

ls /tmp/mntdir

how it works

It mounts a virtual filesystem (using NFS, fuse, or WebDav) and mounts it with the mount command. It doesn't work on Windows but probably could be made to.

Because the filesystem is backed by your .git directory, it doesn't use any disk space. It more or less updates live, though I've noticed that sometimes the NFS version lags behind a bit, probably because of caching.

NFS, FUSE, DAV

there are 3 different filesystem implementations. I'd suggest:

  • -type fuse if you're on Linux
  • -type nfs if you're on Mac OS (because FUSE on Mac is annoying)
  • -type webdav is broken because I couldn't get symlinks on webdav to work. just leaving the webdav code in there in case it's salvageable.

You can try to use the FUSE version on Mac with MacFuse or FUSE-T if you want though.

a tour of the folders

I might change all of this but right now there are four main subfolders. commits/ contains all the commits, and everything else is a symlink to a commit.

$ ls /tmp/mntdir
branches/  branch_histories/  commits/  tags/

commits

the commits/ directory is split by commit prefix so that it isn't horrible to list. For example:

$ ls /tmp/mntdir/commits/
0a  02  1a  2c  3e  5a  6c  7e  9a  12  20  28  36  44  52  60  68  76
$ ls /tmp/mntdir/commits/73/73a0/
73a08ab44ccbf1a305c458c35ab35661f0b7a7f3
$ ls /tmp/mntdir/commits/da/da83/da83dce00782814ecfd33ef6d968ff9e43188a94/
branches.go  commit.go  go.mod  go.sum  main.go  symlink.go

tags

$ ls /tmp/mntdir/tags/
v0.000@
$ ls /tmp/mntdir/tags/v0.000/
branches.go  branch_histories.go  commit.go  go.mod  go.sum  main.go  symlink.go  tags.go

branches

$ ls /tmp/mntdir/branches/
main@  test@
$ ls /tmp/mntdir/branches/main/
branches.go  branch_histories.go  commit.go  go.mod  go.sum  main.go  symlink.go

branch histories

shows the last 100 commits on a branch. They're numbered, 0 is the most recent.

here we'll look at the code from 4 versions ago

$ ls /tmp/mntdir/branch_histories/main/
00-f1e4200744ae2fbe584d3ad3638cf61593a11624@  02-dc49186e766bcdb62a3958533a62d3fd626b253e@  04-b9c9e9f09cc918825066f105d62c550cc3c0958e@
01-03bf66122c3acf44fb781f27cd41415af75fcbe4@  03-da83dce00782814ecfd33ef6d968ff9e43188a94@  05-97d8dea79acb702b3ad66e08218c26c2fda9b1de@
$ ls /tmp/mntdir/branch_histories/main/04-b9c9e9f09cc918825066f105d62c550cc3c0958e/
commit.go  go.mod  go.sum  main.go

cool stuff you can do

you can go into your branch and grep for the code you deleted!

$ cd /tmp/mntdir/branch_histories/main
$ grep 'func readBlob' */commit.go
03-fc450bb99460b9b793fcc36ca79b74caf6a9bc2a/commit.go:func readBlob(repo *git.Repository, id plumbing.Hash) ([]byte, error) {

bugs

there are 1 million bugs and limitations. I may or may not ever fix any of them. It's read only so it shouldn't do any harm to your git repository though, I think the worst thing that can happen is that it'll mislead you about something or be really slow to unmount. Also it caches every commit ID in your repository in memory so maybe that's bad if you have a truly gigantic repository.

thanks

thanks to vasi for explaining one hundred things about filesystems to me

similar projects

More Repositories

1

pandas-cookbook

Recipes for using Python's pandas library
Jupyter Notebook
6,290
star
2

dnspeep

spy on the DNS queries your computer is making
Rust
1,346
star
3

teeceepee

mini-TCP stack in Python, for fun
Python
552
star
4

kernel-module-fun

Some fun things you can do with kernel modules (all "bad ideas")
C
431
star
5

git-workflow

Tool to visualize your git workflow, in a pretty graph
Python
371
star
6

nginx-playground

JavaScript
354
star
7

dns-lookup

HTML
334
star
8

shell-examples

Shell
279
star
9

mess-with-dns

Source for Mess With DNS
Go
224
star
10

vue3-tiny-template

HTML
217
star
11

dns-weekend

Code for Implement DNS in a Weekend
Jupyter Notebook
192
star
12

tiny-resolver

Go
185
star
13

neural-nets-are-weird

Jupyter Notebook
166
star
14

gzip.jl

Gzip in julia! =D =D
C
161
star
15

svg2notability

convert from svg to notability format
Python
137
star
16

twine-stories

twine
Python
133
star
17

svg_crossworder

Python script to generate SVG crosswords from a text file
Python
119
star
18

snake

snake, in C, with ncurses!
C
116
star
19

dig-pretty

Python
81
star
20

zine-formatter

Small Python script for formatting zines into booklets
Python
77
star
21

vimconfig

Vim Script
55
star
22

julia-drawings

CSS
55
star
23

focus-reply-fastmail

a hacky focus & reply feature for fastmail
JavaScript
52
star
24

howcomputer

how does a computer even (or: fun with profiling)
C
52
star
25

snake.rs

snake in Rust!
Rust
51
star
26

mastodon-threaded-replies

JavaScript
50
star
27

tiny-tls

Go
49
star
28

ltrace-bcc

ltrace clone that uses bcc + uprobes instead of ptrace
Rust
46
star
29

dns-doctor

Go
46
star
30

talks

IPython notebooks and slides for talks I've given
Jupyter Notebook
44
star
31

gzip-huffman-tree

Prints the Huffman table for a gzip file
Python
44
star
32

zine-translations

SVGs of zines that are easier to translate than a PDF
Shell
41
star
33

turn-off-retweets

JavaScript
35
star
34

git-oops

Python
33
star
35

tweets-archive

JavaScript
31
star
36

tiny-python-dns-server

Python
30
star
37

unix-command-survey

Visualization of correlations between HN users' .bash_history
JavaScript
29
star
38

manage-boosts

manage mastodon boosts
JavaScript
28
star
39

guys-guys-guys

The results from a short survey I ran on the use of "guys"
Shell
26
star
40

fun-with-threads

C
23
star
41

masters-thesis

My master's thesis, on the algebra of topological quantum computing
TeX
20
star
42

syscall_menagerie

A menagerie of Linux system calls
19
star
43

forestspy

spy on your random forests
Jupyter Notebook
19
star
44

dotfiles

My dotfiles
Vim Script
18
star
45

julias-first-programs

Python
18
star
46

font-mixer

an attempt at mixing 2 handwriting fonts into a fancier version
Python
16
star
47

sql-playground.wizardzines.com

Vue
16
star
48

ruby-mem-watcher-demo

Rust
16
star
49

nixpkgs

my nix packages
Nix
15
star
50

piper

See which processes are connected to other processes with pipes!
15
star
51

multi-gotty

Go
14
star
52

aoc2020

Python
13
star
53

aoc2022

Rust
12
star
54

tinybuild

Shell
11
star
55

website-example

HTML
11
star
56

discord-neighbourbot

Python
11
star
57

stealthistalk

talk ideas for you to steal
10
star
58

tiny-remote-login

Go
9
star
59

stats-fun

Jupyter Notebook
8
star
60

inside-git

Python
7
star
61

biximap

An improved version of the map at http://montreal.bixi.com
JavaScript
7
star
62

misc-git-tools

a git command line tool that I wrote in 10 minutes
Python
7
star
63

swiss_army_knife_talk

Jupyter Notebook
6
star
64

incident-service

JavaScript
4
star
65

lozyafun2

lozya fun 2
JavaScript
4
star
66

magical-orchestra

Lyndsey and Julia's Magical Orchestra
Clojure
4
star
67

linux-playground

HTML
3
star
68

dns-summer-camp

some materials for a workshop
3
star
69

failed-decryption

Ruby
3
star
70

comments-policy

3
star
71

hadoop_fun

Python
3
star
72

linux-wizard-project

HTML
3
star
73

predixi

Find out when that station is going to be empty! Huge WIP.
Python
3
star
74

rbspy-archive

archive of old rbspy commits (pre-squash)
Rust
3
star
75

cssjs-exercises

HTML
3
star
76

vaccine-scraper

Python
3
star
77

colab-fun

Jupyter Notebook
3
star
78

quicksend

Tiny utility for sending files insecurely on your local network
Python
3
star
79

rust-fun

Fun things, with Rust!
Rust
2
star
80

manage-twitter

JavaScript
2
star
81

axidraw-fun

some miscellaneous axidraw scripts
Python
2
star
82

mithril-tiny-template

HTML
2
star
83

mtlpytutorial

Scripts for montreal python workshop lecture
Python
2
star
84

biximap2

an attempt at a bixi station map
JavaScript
2
star
85

branch-example

2
star
86

change-ringing

Change ringing practice
Clojure
2
star
87

julia-test-app

HTML
1
star
88

clojent

A BitTorrent client in Clojure? WE WILL SEE.
Clojure
1
star
89

ld_preload_fun

C
1
star
90

jvns

1
star
91

sketchrnn-lots-of-faces

JavaScript
1
star
92

mess-with-dns-backend-old

Go
1
star
93

test-mac-freeze

Rust
1
star
94

fake-website

CSS
1
star
95

git-merge-sad

1
star
96

jvns-redesign

CSS
1
star
97

hey-mr-kernigan

Some exercises from Kernigan & Ritchie
C
1
star