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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
# Tasks
## TODO Separate `gitstatic_main` out of `main` {#task-d6cab5ad-0405-5190-f918-766b81daf8c0}
- TODO in 2021-08-17
---
Make it receive an allocator parameter, and enable building a `libgistatic.a`
library too and receiving a top-level allocator parameter.
## TODO Have a PRNG so I do not depend on `/dev/urandom` {#task-e99fa50b-75ea-21fb-6b4d-84447646cdea}
- TODO in 2021-08-13
## TODO Create `libgistatic.a` {#task-2e2ad57f-9c31-69d8-e3d9-2708c2b73403}
- TODO in 2021-08-06
---
Keep `src/gistatic.c` mostly as it is, and move the `main()` to a `src/main.c`
or `src/cli.c` file, and build the executable from there.
## TODO Remove spaces around `git clone ...` when copying to clipboard in the browser {#task-cd214149-a183-9bd3-292a-d48b3fb85050}
- TODO in 2021-08-02
## TODO Add description to submodules {#task-5b4b46b6-b1e8-6ba0-4f26-fab9de6a0e75}
- TODO in 2021-07-31
## TODO Create an "honest list of drawbacks" {#task-b3d67f87-c55a-a9b6-c9f8-c2f57d2f5803} tag:docs
- TODO in 2021-07-31
---
Inspired by [Purelymail](https://purelymail.com/).
Add both to the `README.md` and to the manpages.
Current items:
- can't compare commits: this
requires `O(n!)` code and HTML to be generated;
## TODO Integrate `fallible` or other form of fault injection into the test suite {#task-ca8d80ae-9d31-5dfa-03de-b3cfccf2a8b2}
- TODO in 2021-07-31
## TODO Add CSS media query for dark mode {#task-07c14c08-3757-ced7-36f8-d1ec5c437633}
- TODO in 2021-07-31
## TODO Translate `README.md`, `CHANGELOG.md` and `src/gistatic.msg` {#task-21d7dcb9-adfe-e8d6-64fa-39d5972b5d83}
- TODO in 2021-07-31
---
- <input type="checkbox" disabled /> `README.md`
- <input type="checkbox" disabled /> `CHANGELOG.md`
- <input type="checkbox" disabled /> `src/gistatic.msg`
## TODO Add Valgrind, sanitizers and fuzzers to the test suit {#task-a6bdaeb0-7099-c728-2b7c-b080aa2fba33}
- TODO in 2021-07-31
---
Tools references:
- [sanitizers] from clang
- [LibFuzzer], also from clang
- [clang-tidy]
- [Milu], mutation testing
Links I found useful:
- <https://developers.redhat.com/blog/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan>
- <https://www.jetbrains.com/help/clion/google-sanitizers.html#makefiles-compdb>
- <https://www.youtube.com/watch?v=FP8zFhB_cOo>
[sanitizers]: https://clang.llvm.org/docs/
[LibFuzzer]: https://llvm.org/docs/LibFuzzer.html
[clang-tidy]: https://clang.llvm.org/extra/clang-tidy/
[Milu]: https://github.com/yuejia/Milu
## DONE Embed `src/unit-test.{c,h}` into `src/gistatic.c` {#task-ae96e5b6-ab04-3a3d-1777-b28031273a19}
- DONE in 2021-07-31
Done in
[`d843a40a039936b4d9b2b7b7552b88e9944bdd95`](https://git.euandreh.xyz/gistatic/commit/?id=d843a40a039936b4d9b2b7b7552b88e9944bdd95).
- TODO in 2021-07-31
## TODO Add explanation and comparison to stagit and CGit {#task-39e71afe-4ac9-4c3d-97e4-9ac41f826089}
- TODO in 2021-06-11
## CANCELLED Synchronize Cargo.toml version and Makefile {#task-09018dd8-f1a2-4b0b-a56f-dea9fdc78d99}
- CANCELLED in 2021-08-01
Not applicable: it is not Rust, but C.
- TODO in 2021-05-31
---
The version in the Makefile is the primary one.
## TODO v0 Overview {#task-946c7f4f-2b97-40ff-b620-5fc241900709}
- TODO in 2021-03-05
---
- [ ] hierarquical tree view, per branch and per commit
- [ ] show notes in commit
- [ ] `tarballs/` folder, with `.tar.xz` and `.tar.xz.asc` files
- [ ] generate tarballs for all tags and all branches
- [ ] SHA in log
- [ ] `.patch` files (with `git format-patch --stdout -1 $SHA`), raw view
- [ ] blame view, with history
- [ ] highlight code
- [ ] render markdown
- [ ] leverage `cloc`
- [ ] Atom feed of commits and releases
- [ ] use mustache for generating HTML and Gemini files
Benchmark on (stagit):
- Git: 60k commits, 100MB repository
- Guix: 75k commits, 311MB repository
- Nixpkgs: 275k commits, 2.5GB repository
- Linux: 1M commits, 2,5GB repository
# Bugs
# Improvements
# Questions
## TODO Can one change the font? {#question-93d85890-41dd-f856-a6f9-801d948f76ce}
- TODO in 2021-08-17
---
When using assistive technology, or just ordinary browser configuration, can the
user change the font: be it size, family, weight, etc.?
What about on mobile?
## TODO Should there be an alt for the logo images? {#question-87b2068f-85dd-25e9-b0c6-5e41fbbb04ca}
- TODO in 2021-08-17
---
For the index of repositories, the logo isn't a link.
At most, it is a link to itself, which isn't really useful.
In this case, an alt like "Logo image of the repository list" isn't as useful,
and a description of the actual image itself after its purpose would be better.
For the repository pages, the logo is a link to the index page, and this role is
more relevant.
Beyond the description of the logo, a phrase stating that it is a link to the
repository list is probably a good thing.
## DONE How to embed repositories without using submodules {#question-5414aee2-031a-5759-2a22-d572ee899ac0}
- DONE in 2021-08-04
By using a special `.gitdir` directory on the embedded repositories, the toplevel repository
can remain unchanged and include those.
Done in
[`252430e9ea5996c21c1fe24de623f458a24edbb7`](https://git.euandreh.xyz/gistatic/commit/?id=252430e9ea5996c21c1fe24de623f458a24edbb7).
- TODO in 2021-07-31
---
I want to embed repositories so that I can use them in unit and integration
tests, but making them submodules makes the repository much less standalone than
I would like.
# Decisions
## DONE Duplicate stylesheet and logo {#decision-c725e140-99fb-802d-f5ad-44577593212a}
- DONE in 2021-08-17
---
The `style.css` and `logo.svg` files are being duplicated when generating the
HTML for the repository and for the index of repositories.
Right now, I'm choosing to keep it that way.
The reasoning is: when generating the HTML for a repository, this process is
self-contained, and doesn't depend on the existence of a index of repositories
in the parent directory.
## DONE Perl vs C {#decision-d349b5be-3e00-4e00-a110-0eb7f402d4ab}
- DONE in 2021-05-28
- TODO in 2021-03-06
---
Instead of Perl vs C, it became Perl vs Rust, and I've chosen Rust.
I choose Rust over C because it is a higher-level language than C is.
It allows me to produce binaries and libraries without extra dependencies (unlike C++'s `libstdc++`), and I can deal with memory management without reference counting (unlike Nim) or garbage collection (unlike D).
I'm favoring Rust as a C-like tool because it allows me to write code that transcends the language barries: with C/Rust code, a `.so` library can be consumed by any programming language on any environment.
The binary application that will be the CLI could be written in any language, also, but it is done so in Rust for convenience.
So the question of Perl vs C now is becoming applicable only on more specific scenarios: when having a `libsomething.so` isn't worth anything.
This isn't the case for this library.
# Resources
- [How are zlib, gzip and zip related? What do they have in common and how are they different?](https://stackoverflow.com/questions/20762094/how-are-zlib-gzip-and-zip-related-what-do-they-have-in-common-and-how-are-they)
- [GZIP file format specification version 4.3](https://datatracker.ietf.org/doc/html/rfc1952)
- [ZLIB Compressed Data Format Specification version 3.3](https://datatracker.ietf.org/doc/html/rfc1950)
- [A simple tar implementation](https://github.com/calccrypto/tar)
- [libtar - C library for manipulating tar files](https://github.com/tklauser/libtar)
- [`static int write_tar_entry()`](https://git.kernel.org/pub/scm/git/git.git/tree/archive-tar.c?id=daab8a564f8bbac55f70f8bf86c070e001a9b006#n242) from Git itself (which is what CGit uses)
# Scratch
|