1<!doctype html>
2<html lang="en">
3<head>
4<meta charset="utf-8">
5<meta name="viewport" content="width=device-width, initial-scale=1">
6<meta name="color-scheme" content="light dark">
7<title>SHA7 add evil.go · diffs · example.test</title>
8<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
9<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0c0c0c">
10<meta name="apple-mobile-web-app-title" content="ermite">
11<link rel="icon" type="image/svg+xml" href="/-/static/img/icon.HASH.svg">
12<link rel="apple-touch-icon" href="/-/static/app/apple-touch-icon.HASH.png">
13<link rel="manifest" href="/-/static/app/manifest.HASH.webmanifest">
14<link rel="preload" href="/-/static/fonts/atkinson-next.HASH.woff2" as="font" type="font/woff2" crossorigin>
15<link rel="stylesheet" href="/-/static/css/ermite.HASH.css">
16<meta name="htmx-config" content='{"history":false,"includeIndicatorCSS":false,"extensions":"sse, hx-live"}'>
17<script src="/-/static/js/htmx.min.HASH.js" defer>
18</script>
19<script src="/-/static/js/hx-live.min.HASH.js" defer>
20</script>
21<script src="/-/static/js/hx-sse.min.HASH.js" defer>
22</script>
23<script src="/-/static/js/ermite.HASH.js" defer>
24</script>
25<script src="/-/static/js/files.HASH.js" defer>
26</script>
27<script src="/-/static/js/passkey.HASH.js" defer>
28</script>
29<script src="/-/static/js/log.HASH.js" defer>
30</script>
31</head>
32<body data-ref="" data-sha="SHA40" data-sel="" data-nav="" data-paths="/diffs/paths/SHA40" data-blob="/diffs/blob/SHA40">
33<a class="skip" href="#main">skip to content</a>
34<header class="hdr">
35<div class="hdr-top">
36<a class="brand" href="/" data-g="h" aria-label="home" title="home (g h)">
37<span class="brand-mark" aria-hidden="true">
38</span>
39</a>
40<nav class="crumbs" aria-label="Path">
41<ol>
42<li>
43<a href="/diffs">diffs</a>
44</li>
45<li>
46<a href="/diffs/commits/main">commit</a>
47</li>
48<li>
49<span aria-current="page">SHA7</span>
50</li>
51</ol>
52</nav>
53<div class="hdr-acts">
54<a class="btn ref" href="/diffs/refs" data-fire="refs" aria-keyshortcuts="b" title="switch branch or tag (b)">
55<span class="ico i-branch" aria-hidden="true">
56</span>
57<span class="ref-name">detached</span>
58<span class="sha">SHA7</span>
59</a>
60<button type="button" class="btn search" data-js aria-haspopup="dialog" aria-controls="panel-cmd" aria-keyshortcuts="Control+K :" title="go to a section, ref, file or repo (ctrl k or :)" data-fire="cmd">
61<span class="ico i-search" aria-hidden="true">
62</span>
63<span class="search-label">Go to…</span>
64<kbd aria-hidden="true">ctrl k</kbd>
65</button>
66</div>
67</div>
68<nav class="tabs" aria-label="Sections">
69<ul>
70<li>
71<a href="/diffs" data-key="s" aria-keyshortcuts="s">Summary <kbd aria-hidden="true">s</kbd>
72</a>
73</li>
74<li>
75<a href="/diffs/tree/main" data-key="t" aria-keyshortcuts="t">Files <kbd aria-hidden="true">t</kbd>
76</a>
77</li>
78<li>
79<a href="/diffs/commits/main" data-key="c" aria-keyshortcuts="c" aria-current="page">Commits <kbd aria-hidden="true">c</kbd>
80</a>
81</li>
82<li>
83<a href="/diffs/refs" data-key="r" aria-keyshortcuts="r">Branches & tags <kbd aria-hidden="true">r</kbd>
84</a>
85</li>
86<li>
87<a href="/diffs/merge-requests" data-key="m" aria-keyshortcuts="m">Merge requests <kbd aria-hidden="true">m</kbd>
88</a>
89</li>
90<li>
91<a href="/diffs/actions" data-key="a" aria-keyshortcuts="a">Actions <kbd aria-hidden="true">a</kbd>
92</a>
93</li>
94</ul>
95</nav>
96</header>
97<div class="work has-rail">
98<main id="main" tabindex="-1">
99<header class="show">
100<h1>add evil.go</h1>
101<pre class="msg">looks <U+202E>fine<U+202C></pre>
102<dl class="kv show-kv">
103<dt>commit</dt>
104<dd>SHA40</dd>
105<dt>author</dt>
106<dd>T · <time datetime="STAMP" title="STAMP">AGO</time> · STAMP</dd>
107<dt>parent</dt>
108<dd>
109<a href="/diffs/commit/SHA40">SHA7</a>
110</dd>
111</dl>
112</header>
113<div class="diff-tools" role="group" aria-label="Diff view">
114<span class="dim">1 file · <span class="plus">+8</span>
115<span class="minus">-0</span>
116</span>
117<span class="grow">
118</span>
119<a href="/diffs/commit/SHA40?view=unified" class="btn vbtn" data-view="unified" aria-keyshortcuts="u" aria-current="true" data-fire="unified" :aria-current="q('#diffs').attr['data-diff'] === this.dataset.view ? 'true' : false">Unified<kbd aria-hidden="true">u</kbd>
120</a>
121<a href="/diffs/commit/SHA40?view=split" class="btn vbtn" data-view="split" aria-keyshortcuts="d" data-fire="split" :aria-current="q('#diffs').attr['data-diff'] === this.dataset.view ? 'true' : false">Split<kbd aria-hidden="true">d</kbd>
122</a>
123<button type="button" aria-keyshortcuts="x" data-js data-fire="collapse" class="btn">
124<span hx-live="this.textContent = q('[data-file][open]').count || !q('[data-file]').count ? 'Collapse all' : 'Expand all'">Collapse all</span>
125<kbd aria-hidden="true">x</kbd>
126</button>
127</div>
128<p class="notice">this diff holds invisible characters (direction controls, zero-width characters). They are shown as <span class="inv"><U+XXXX></span> markers, never applied.</p>
129<div id="diffs" data-diff="unified" hx-live="this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff">
130<details class="dfile lnw-2" id="f1" data-file open>
131<summary>
132<span class="st">A</span>
133<span class="p">evil.go</span>
134<span class="plus">+8</span>
135<span class="minus">-0</span>
136</summary>
137<div class="dscroll">
138<table class="dt uni" aria-label="evil.go, unified">
139<tbody>
140<tr class="hunk">
141<td colspan="4">@@ -0,0 +1,8 @@</td>
142</tr>
143<tr class="add">
144<td class="ln">
145</td>
146<td class="ln">1</td>
147<td class="m">+</td>
148<td class="tx chroma">
149<span class="kn">package</span> evil</td>
150</tr>
151<tr class="add">
152<td class="ln">
153</td>
154<td class="ln">2</td>
155<td class="m">+</td>
156<td class="tx chroma">
157</td>
158</tr>
159<tr class="add">
160<td class="ln">
161</td>
162<td class="ln">3</td>
163<td class="m">+</td>
164<td class="tx chroma">
165<span class="kd">func</span> admin(user string) bool {</td>
166</tr>
167<tr class="add">
168<td class="ln">
169</td>
170<td class="ln">4</td>
171<td class="m">+</td>
172<td class="tx chroma">
173<span class="k">if</span> user == <span class="s">"user</span>
174<span class="inv" title="invisible character"><U+202E></span>
175<span class="s">
176</span>
177<span class="inv" title="invisible character"><U+2066></span>
178<span class="s">// check</span>
179<span class="inv" title="invisible character"><U+2069></span>
180<span class="s">
181</span>
182<span class="inv" title="invisible character"><U+2066></span>
183<span class="s">"</span> {</td>
184</tr>
185<tr class="add">
186<td class="ln">
187</td>
188<td class="ln">5</td>
189<td class="m">+</td>
190<td class="tx chroma">
191<span class="k">return</span>
192<span class="kc">true</span>
193<span class="c1">// z</span>
194<span class="inv" title="invisible character"><U+200B></span>
195<span class="c1">w</span>
196</td>
197</tr>
198<tr class="add">
199<td class="ln">
200</td>
201<td class="ln">6</td>
202<td class="m">+</td>
203<td class="tx chroma"> }</td>
204</tr>
205<tr class="add">
206<td class="ln">
207</td>
208<td class="ln">7</td>
209<td class="m">+</td>
210<td class="tx chroma">
211<span class="k">return</span>
212<span class="kc">false</span>
213</td>
214</tr>
215<tr class="add">
216<td class="ln">
217</td>
218<td class="ln">8</td>
219<td class="m">+</td>
220<td class="tx chroma">}</td>
221</tr>
222</tbody>
223</table>
224<table class="dt spl" aria-label="evil.go, split">
225<colgroup>
226<col class="c-ln">
227<col class="c-m">
228<col>
229<col class="c-ln">
230<col class="c-m">
231<col>
232</colgroup>
233<tbody>
234<tr class="hunk">
235<td colspan="6">@@ -0,0 +1,8 @@</td>
236</tr>
237<tr>
238<td class="ln none">
239</td>
240<td class="m none">
241</td>
242<td class="tx none">
243</td>
244<td class="ln add">1</td>
245<td class="m add">+</td>
246<td class="tx chroma add">
247<span class="kn">package</span> evil</td>
248</tr>
249<tr>
250<td class="ln none">
251</td>
252<td class="m none">
253</td>
254<td class="tx none">
255</td>
256<td class="ln add">2</td>
257<td class="m add">+</td>
258<td class="tx chroma add">
259</td>
260</tr>
261<tr>
262<td class="ln none">
263</td>
264<td class="m none">
265</td>
266<td class="tx none">
267</td>
268<td class="ln add">3</td>
269<td class="m add">+</td>
270<td class="tx chroma add">
271<span class="kd">func</span> admin(user string) bool {</td>
272</tr>
273<tr>
274<td class="ln none">
275</td>
276<td class="m none">
277</td>
278<td class="tx none">
279</td>
280<td class="ln add">4</td>
281<td class="m add">+</td>
282<td class="tx chroma add">
283<span class="k">if</span> user == <span class="s">"user</span>
284<span class="inv" title="invisible character"><U+202E></span>
285<span class="s">
286</span>
287<span class="inv" title="invisible character"><U+2066></span>
288<span class="s">// check</span>
289<span class="inv" title="invisible character"><U+2069></span>
290<span class="s">
291</span>
292<span class="inv" title="invisible character"><U+2066></span>
293<span class="s">"</span> {</td>
294</tr>
295<tr>
296<td class="ln none">
297</td>
298<td class="m none">
299</td>
300<td class="tx none">
301</td>
302<td class="ln add">5</td>
303<td class="m add">+</td>
304<td class="tx chroma add">
305<span class="k">return</span>
306<span class="kc">true</span>
307<span class="c1">// z</span>
308<span class="inv" title="invisible character"><U+200B></span>
309<span class="c1">w</span>
310</td>
311</tr>
312<tr>
313<td class="ln none">
314</td>
315<td class="m none">
316</td>
317<td class="tx none">
318</td>
319<td class="ln add">6</td>
320<td class="m add">+</td>
321<td class="tx chroma add"> }</td>
322</tr>
323<tr>
324<td class="ln none">
325</td>
326<td class="m none">
327</td>
328<td class="tx none">
329</td>
330<td class="ln add">7</td>
331<td class="m add">+</td>
332<td class="tx chroma add">
333<span class="k">return</span>
334<span class="kc">false</span>
335</td>
336</tr>
337<tr>
338<td class="ln none">
339</td>
340<td class="m none">
341</td>
342<td class="tx none">
343</td>
344<td class="ln add">8</td>
345<td class="m add">+</td>
346<td class="tx chroma add">}</td>
347</tr>
348</tbody>
349</table>
350</div>
351</details>
352</div>
353</main>
354<aside class="rail" aria-label="Context">
355<section aria-labelledby="r-files">
356<h2 id="r-files">Files <span class="count">1</span>
357</h2>
358<ol class="files" aria-label="Changed files">
359<li>
360<a href="#f1" title="evil.go" hx-on:click="(window.ermiteMR?.openFile || ermite.openFile)(this.hash.slice(1))">
361<span class="st" data-st="A" title="added">A</span>
362<span class="nm">
363<span class="p">evil.go</span>
364<span class="d">
365<bdi>
366</bdi>
367</span>
368</span>
369<span class="n">
370<span class="plus">+8</span>
371<span class="minus">-0</span>
372</span>
373</a>
374</li>
375</ol>
376</section>
377</aside>
378</div>
379<footer class="foot">
380<span>ermite devel</span>
381<a href="http://example.test/ermite" rel="noopener" title="source of this version (AGPL-3.0-or-later)">source</a>
382<button type="button" class="foot-keys" data-js data-fire="help" aria-haspopup="dialog" aria-controls="panel-help" aria-keyshortcuts="?">
383<kbd aria-hidden="true">?</kbd> keyboard shortcuts</button>
384</footer>
385<div class="hint" role="status" aria-live="polite">
386<span class="hint-nav" :text="document.body.dataset.nav || ''">
387</span>
388<span class="hint-sel" :text="document.body.dataset.sel ? document.body.dataset.sel + ' · y permalink' : ''">
389</span>
390<span class="hint-flash" :text="document.body.dataset.flash || ''">
391</span>
392</div>
393<dialog id="panel-help" class="panel modal" aria-label="Keyboard shortcuts" hx-on:keydown="event.key === 'Escape' && (event.preventDefault(), this.close())" hx-on:click="event.target === this && this.close()">
394<div class="panel-head">
395<h2>Keyboard shortcuts</h2>
396<button type="button" class="panel-x" aria-label="Close" hx-on:click="closest('dialog').close()">
397<kbd>esc</kbd> close</button>
398</div>
399<div class="keys-pref">
400<label>
401<input type="checkbox" id="keys-off" aria-describedby="keys-note" hx-on:change="ermite.setKeysOff(this.checked)"> Turn off single-key shortcuts</label>
402<p id="keys-note" class="dim">Single-key shortcuts are on. ctrl k and esc work whatever this says.</p>
403</div>
404<dl class="keys">
405<div>
406<dt>
407<kbd>ctrl k</kbd>
408<kbd>:</kbd>
409</dt>
410<dd>go to a section, branch, tag, file or repository</dd>
411</div>
412<div>
413<dt>
414<kbd>?</kbd>
415</dt>
416<dd>this list</dd>
417</div>
418<div>
419<dt>
420<kbd>j</kbd>
421<kbd>k</kbd>
422</dt>
423<dd>move the row cursor down / up</dd>
424</div>
425<div>
426<dt>
427<kbd>enter</kbd>
428</dt>
429<dd>open the row under the cursor; on Files, a directory opens or closes in place</dd>
430</div>
431<div>
432<dt>
433<kbd>↑</kbd>
434<kbd>↓</kbd>
435<kbd>←</kbd>
436<kbd>→</kbd>
437<kbd>home</kbd>
438<kbd>end</kbd>
439</dt>
440<dd>in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file</dd>
441</div>
442<div>
443<dt>
444<kbd>l</kbd>
445<kbd>h</kbd>
446</dt>
447<dd>on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls</dd>
448</div>
449<div>
450<dt>
451<kbd>g g</kbd>
452<kbd>G</kbd>
453</dt>
454<dd>first / last row</dd>
455</div>
456<div>
457<dt>
458<kbd>/</kbd>
459</dt>
460<dd>filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)</dd>
461</div>
462<div>
463<dt>
464<kbd>b</kbd>
465</dt>
466<dd>switch branch or tag</dd>
467</div>
468<div>
469<dt>
470<kbd>s</kbd>
471<kbd>t</kbd>
472<kbd>c</kbd>
473<kbd>r</kbd>
474<kbd>m</kbd>
475</dt>
476<dd>tabs: summary, files, commits, branches & tags, merge requests</dd>
477</div>
478<div>
479<dt>
480<kbd>g h</kbd>
481</dt>
482<dd>home</dd>
483</div>
484<div>
485<dt>
486<kbd>y</kbd>
487</dt>
488<dd>copy a permalink pinned to the commit</dd>
489</div>
490<div>
491<dt>
492<kbd>d</kbd>
493<kbd>u</kbd>
494<kbd>x</kbd>
495</dt>
496<dd>diff: split / unified / collapse or expand all</dd>
497</div>
498<div>
499<dt>
500<kbd>e</kbd>
501<kbd>E</kbd>
502</dt>
503<dd>diff: the whole file in view / every file, with the lines the hunks hide</dd>
504</div>
505<div>
506<dt>
507<kbd>n</kbd>
508</dt>
509<dd>merge request: next note in the diff</dd>
510</div>
511<div>
512<dt>
513<kbd>esc</kbd>
514</dt>
515<dd>close a dialog, leave a field</dd>
516</div>
517</dl>
518</dialog>
519<dialog id="panel-refs" class="panel modal" aria-label="Switch ref" hx-on:keydown="event.key === 'Escape' && (event.preventDefault(), this.close())" hx-on:click="event.target === this && this.close()">
520<div class="panel-head">
521<label for="refs-filter" class="sr">filter branches and tags</label>
522<input id="refs-filter" type="search" placeholder="Switch branch or tag…" autocomplete="off" data-pick="#panel-refs li" hx-on:input="ermite.filter(this)">
523<button type="button" class="panel-x" aria-label="Close" hx-on:click="closest('dialog').close()">
524<kbd>esc</kbd>
525</button>
526</div>
527<div class="panel-cols" data-picklist>
528<section aria-label="Branches">
529<h2>Branches <span class="count">2</span>
530</h2>
531<ul>
532<li>
533<a href="/diffs/tree/main">
534<span class="mark" aria-hidden="true"> </span>main</a>
535</li>
536<li>
537<a href="/diffs/tree/side">
538<span class="mark" aria-hidden="true"> </span>side</a>
539</li>
540</ul>
541</section>
542<section aria-label="Tags">
543<h2>Tags <span class="count">1</span>
544</h2>
545<ul>
546<li>
547<a href="/diffs/tree/v1.0.0">
548<span class="mark" aria-hidden="true"> </span>v1.0.0</a>
549</li>
550</ul>
551</section>
552</div>
553</dialog>
554<dialog id="panel-cmd" class="panel modal" aria-label="Go to" hx-on:close="ermiteFinder.paletteClose()" hx-on:keydown="event.key === 'Escape' && (event.preventDefault(), this.close())" hx-on:click="event.target === this && this.close()">
555<div class="panel-head">
556<label for="cmd-q" class="sr">go to</label>
557<input id="cmd-q" type="search" placeholder="Go to a section, branch, tag, file or repository…" autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" aria-controls="cmd-list" aria-activedescendant="cmd-o0" hx-on:input="ermite.cmdFilter(this); ermiteFinder.palette(this)" hx-on:keydown="ermite.cmdKey(event)">
558<button type="button" class="panel-x" aria-label="Close" hx-on:click="closest('dialog').close()">
559<kbd>esc</kbd>
560</button>
561</div>
562<ul id="cmd-list" class="cmd-list" role="listbox" aria-label="Targets">
563<li id="cmd-o0" role="option" aria-selected="true" data-k="go home" data-cursor>
564<a href="/" tabindex="-1">
565<span class="lbl">home</span>
566<span class="k">go</span>
567</a>
568</li>
569<li id="cmd-o1" role="option" aria-selected="false" data-k="section summary">
570<a href="/diffs" tabindex="-1">
571<span class="lbl">summary</span>
572<span class="k">section</span>
573</a>
574</li>
575<li id="cmd-o2" role="option" aria-selected="false" data-k="section files">
576<a href="/diffs/tree/main" tabindex="-1">
577<span class="lbl">files</span>
578<span class="k">section</span>
579</a>
580</li>
581<li id="cmd-o3" role="option" aria-selected="false" data-k="section commits">
582<a href="/diffs/commits/main" tabindex="-1">
583<span class="lbl">commits</span>
584<span class="k">section</span>
585</a>
586</li>
587<li id="cmd-o4" role="option" aria-selected="false" data-k="section branches & tags">
588<a href="/diffs/refs" tabindex="-1">
589<span class="lbl">branches & tags</span>
590<span class="k">section</span>
591</a>
592</li>
593<li id="cmd-o5" role="option" aria-selected="false" data-k="section merge requests">
594<a href="/diffs/merge-requests" tabindex="-1">
595<span class="lbl">merge requests</span>
596<span class="k">section</span>
597</a>
598</li>
599<li id="cmd-o6" role="option" aria-selected="false" data-k="section actions">
600<a href="/diffs/actions" tabindex="-1">
601<span class="lbl">actions</span>
602<span class="k">section</span>
603</a>
604</li>
605<li id="cmd-o7" role="option" aria-selected="false" data-k="branch main">
606<a href="/diffs/tree/main" tabindex="-1">
607<span class="lbl">main</span>
608<span class="k">branch</span>
609</a>
610</li>
611<li id="cmd-o8" role="option" aria-selected="false" data-k="branch side">
612<a href="/diffs/tree/side" tabindex="-1">
613<span class="lbl">side</span>
614<span class="k">branch</span>
615</a>
616</li>
617<li id="cmd-o9" role="option" aria-selected="false" data-k="tag v1.0.0">
618<a href="/diffs/tree/v1.0.0" tabindex="-1">
619<span class="lbl">v1.0.0</span>
620<span class="k">tag</span>
621</a>
622</li>
623<li id="cmd-o10" role="option" aria-selected="false" data-k="action turn single-key shortcuts on off keyboard">
624<a href="#" data-fire="keys" tabindex="-1">
625<span class="lbl">turn single-key shortcuts off</span>
626<span class="k">action</span>
627</a>
628</li>
629</ul>
630<p class="panel-foot">
631<span>
632<kbd>↑</kbd>
633<kbd>↓</kbd> move</span>
634<span>
635<kbd>enter</kbd> open</span>
636<span>
637<kbd>esc</kbd> close</span>
638</p>
639</dialog>
640<div id="keys" hidden hx-on="k-j from:body -> ermite.move(1);
641 k-k from:body -> ermite.move(-1);
642 k-top from:body -> ermite.edge(false);
643 k-bottom from:body -> ermite.edge(true);
644 k-open from:body -> ermite.open();
645 k-right from:body -> ermite.rail(true);
646 k-left from:body -> ermite.rail(false);
647 k-esc from:body -> ermite.closeDialogs();
648 k-help from:body -> ermite.dialog('panel-help');
649 k-refs from:body -> ermite.dialog('panel-refs', 'refs-filter');
650 k-cmd from:body -> ermite.dialog('panel-cmd', 'cmd-q'); ermiteFinder.load();
651 k-filter from:body -> ermite.focusFilter();
652 k-gh from:body -> ermite.go('.brand');
653 k-s from:body -> ermite.tab('s');
654 k-t from:body -> ermite.tab('t');
655 k-c from:body -> ermite.tab('c');
656 k-r from:body -> ermite.tab('r');
657 k-m from:body -> ermite.tab('m');
658 k-next from:body -> ermite.nextNote();
659 k-split from:body -> ermite.layout('split');
660 k-unified from:body -> ermite.layout('unified');
661 k-collapse from:body -> ermite.collapse();
662 k-expand from:body -> ermite.expandFile();
663 k-expandAll from:body -> ermite.expandAll();
664 k-permalink from:body -> ermite.permalink();
665 k-merge from:body -> window.ermiteMR?.openMerge();
666 k-read from:body -> window.ermiteMR?.markRead();
667 k-gf from:body -> window.ermiteMR?.focusFiles();
668 k-keys from:body -> ermite.toggleKeys()">
669</div>
670</body>
671</html>