Jay Taylor's notes

back to listing index

~sircmpwn/shit: README.md - sourcehut git

[web search]
Original source (git.sr.ht)
Tags: git shit git-internals porcelain sircmpwn drew-devault git.sr.ht
Clipped on: 2020-02-13

shit/README.md -rw-r--r-- 1.4 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# shit

shit == Shell Git

This is an implementation of Git using (almost) entirely POSIX shell.

Caveats:

- There are a couple of GNU coreutilsisms, which are marked with "XXX: GNUism"
  throughout. They have been tested on BusyBox as well.
- A native zlib implementation is required: [zlib](https://github.com/kevin-cantwell/zlib)
- Why the fuck would you use this

## Status

Enough plumbing commands are written to make this write the initial commit with
itself, which is how the initial commit was written. Huzzah.

## How to use

1. Don't

Okay, fine. Because only plumbing commands are implemented, you have to live
with a garbage manual process. Do something like this:

```
git clone https://git.sr.ht/~sircmpwn/shit
mkdir my-project
cd my-project
../shit/init
# Write some code
```

So we'll assume shit is at `../shit`.

To create a new index from all of your files (note, subdirectories aren't
working yet):

```
../shit/update-index *
```

Then to create a tree object from these:

```
../shit/write-tree | ./hash-object -t tree -w
```

This will print the tree ID to stdout. Use that to make a commit:

```
export GIT_AUTHOR_NAME="Your Name"
export GIT_AUTHOR_EMAIL="you@example.org"
../shit/commit-tree <tree sha> | ./hash-object -t commit -w
```

This will print out the new commit's SHA. To update master to point to this new
commit:

```
echo <commit sha> > .git/refs/heads/master
```

Tada.