Skip to content

Commit 279de7d

Browse files
committed
update
0 parents  commit 279de7d

1,456 files changed

Lines changed: 112539 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export PATH="$PWD/go/zit/build:$PATH"

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
zz-tests_bats/migration/v*/** merge=ours

.github/workflows/nix.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish every Git push to main to FlakeHub
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
defaults:
9+
run:
10+
working-directory: ./go/zit
11+
12+
jobs:
13+
14+
flakehub-publish:
15+
runs-on: "ubuntu-latest"
16+
permissions:
17+
id-token: "write"
18+
contents: "read"
19+
steps:
20+
- uses: "actions/checkout@v4"
21+
- uses: "DeterminateSystems/nix-installer-action@main"
22+
with:
23+
determinate: true
24+
- uses: "DeterminateSystems/flakehub-push@main"
25+
with:
26+
name: "friedenberg/zit-go"
27+
rolling: true
28+
visibility: "public"
29+
include-output-paths: true
30+
directory: ./go/zit
31+
32+
build-nix-package:
33+
runs-on: ubuntu-22.04
34+
permissions:
35+
contents: read
36+
id-token: write
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: DeterminateSystems/nix-installer-action@main
40+
with:
41+
determinate: true
42+
- uses: DeterminateSystems/flakehub-cache-action@main
43+
- run: nix build
44+
working-directory: ./go/zit

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
result
15+
build/
16+
build_options/
17+
.direnv/

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "zz-test/test_helper/bats-support"]
2+
path = zz-tests_bats/test_helper/bats-support
3+
url = https://github.com/bats-core/bats-support.git
4+
[submodule "zz-test/test_helper/bats-assert"]
5+
path = zz-tests_bats/test_helper/bats-assert
6+
url = https://github.com/bats-core/bats-assert.git

.mr-build-and-watch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Sasha F
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# what is zit
2+
3+
Zit is a combination of "Zettelkasten" and "Git". Zettelkasten is a
4+
knowledge-management method that is used by academics and professionals to graph
5+
their thinking to make it more usable and navigable.
6+
7+
Zit both Zettelkasten and Git as inspiration:
8+
9+
- everything has an automatically-assigned identifier
10+
- flat hierarchy (no directories)
11+
- tags
12+
- everything is a note or blob
13+
- every change is tracked and saved
14+
15+
Normally in Zettelkasten, timestamps are used as identifiers. Zit deviates from
16+
this as timestamps are not very ergonomic to type, autocomplete, or
17+
disambiguate. Zit instead uses an identifier system that combines two lists of
18+
user-supplied identifiers to generate unique combinations. Here's an example:
19+
20+
- user supplies two lists
21+
- list a
22+
- red
23+
- green
24+
- blue
25+
- list b
26+
- apple
27+
- banana
28+
- orange
29+
- possible identifiers
30+
- red/apple
31+
- red/banana
32+
- red/orange
33+
- ...
34+
- blue/orange
35+
- as new zettels are created, new and unused combinations are used to generate
36+
new identifiers that are then assigned to the zettel
37+
38+
# naming of components
39+
40+
If you make the mistake of looking at the code and trying to make sense of it,
41+
you'll notice something pretty quickly: there are a lot of bizarre names:
42+
43+
- Akte: file
44+
- Angeboren: congenital config (*cannot* be changed after init)
45+
- Bestandsaufnahme: inventory list (like a git commit)
46+
- Bezeichnung: description
47+
- Erworben: acquired config (*can* be changed after init)
48+
- Etikett: tag
49+
- Gattung: genre (of the object that is being stored)
50+
- Hinweis: identifier for a Zettel chain
51+
- Kasten: repo
52+
- Kennung: identifier
53+
- Konfig: configuration
54+
- Metadatei: metadata
55+
- Objekte: object
56+
- Schlussel: key
57+
- Schlummernd: "sleeping or dormant", objects that are hidden from ordinary
58+
queries and must be explicitly recalled using the `?` operator, or
59+
explicitly recalled using their direct `Kennnung` (id)
60+
- Schnittstellen: interface
61+
- Sku: stock-keeping unit, representing an entry in a Bestandsaufnahme
62+
- Standort: directory (all directory operations are consolidated here)
63+
- Typ: type
64+
- Umwelt: environment
65+
- Verweise: refs
66+
- Verzeichnisse: cache / index
67+
- Zettel: note / object
68+
69+
The above non-exhaustive list captures some of them. These are all
70+
google-translate looked up names of I've used to describe components of
71+
72+
# directory structure
73+
74+
## top-level
75+
76+
I originally wrote this project in Go. However, as the project has grown larger,
77+
I've bumped into some of Go's tradeoffs that have led me to attempt rewriting
78+
small parts of Zit in Rust.
79+
80+
## per-edition
81+
82+
Besides the entrypoints (e.g., main.go, main.rs), each edition uses a strategy
83+
for forcing modularity and unidirectional dependencies like so:
84+
85+
- zit/go/zit
86+
- main.go
87+
- src/
88+
- alfa
89+
- errors
90+
- bravo
91+
- files
92+
- charlie
93+
- file_lock
94+
95+
In the above selection, code in the `file_lock` module may depend on anything at
96+
the `alfa` and `bravo` levels. Code in the `files` module may depend on anything
97+
at the `alfa` level. And code in `alfa` may only depend on stdlib or external
98+
modules.
99+
100+
For the code "levels", the NATO-phonetic alphabet is used. The benefits of this
101+
approach are it encourages modularity and creating a pyramid-like structure of
102+
dependency. For languages like Go, circular dependencies are not allowed and so
103+
this approach prevents hard-to-untangle dependency refactors. For Rust, this
104+
approach may help with build-times.
105+
106+
# how do I use it?

bin/chflags.bash

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#! /bin/bash -e
2+
3+
if [[ "$(uname -s)" != "Darwin" ]]; then
4+
exit 0
5+
fi
6+
7+
chflags "$@"
8+

go/.claude/settings.local.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(find:*)",
5+
"Bash(rg:*)",
6+
"Bash(grep:*)",
7+
"Bash(go test:*)",
8+
"Bash(go build:*)",
9+
"Bash(just build)",
10+
"Bash(ls:*)",
11+
"Bash(/nix/store/py4d89wsspd0s6rwgjz6lhsy5z3791sd-claude-code-1.0.17/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg \"^func \\([a-z]\\) [A-Z]\" --type go)",
12+
"WebFetch(domain:docs.anthropic.com)"
13+
],
14+
"deny": []
15+
}
16+
}

0 commit comments

Comments
 (0)