v0.32.0 53e25a3

history.go RawHistoryFolder

1// SPDX-License-Identifier: AGPL-3.0-or-later
2
3package readertest
4
5import "testing"
6
7// History is the repository of the read tests: three commits on main, a
8// branch with a slash, a merge, lightweight and annotated tags.
9type History struct {
10	*Fixture
11	C1, C2, C3, Side, Merge string
12}
13
14func NewHistory(t *testing.T, data string) *History {
15	t.Helper()
16	f := NewFixture(t, data, "hist")
17	h := &History{Fixture: f}
18	f.Write("a.txt", "one\ntwo\nthree\n").
19		WriteBytes("bin", []byte{0, 1}).
20		Write("d/f", "hi\n").
21		Write("d/sub/g", "deep\n").
22		Write("we:ird*.txt", "x").
23		Write("README.md", "# hello\n").
24		Write("empty", "")
25	h.C1 = f.Commit("first\n\nbody of the first commit\n")
26
27	f.Mv("a.txt", "b.txt").Write("b.txt", "one\ntwo\nthree\nfour\n").
28		WriteBytes("bin", []byte{0, 2}).
29		Chmod("d/f", 0o755).
30		Write("n.txt", "new\nnonl").
31		Remove("README.md")
32	h.C2 = f.Commit("second")
33
34	f.Remove("n.txt").Symlink("b.txt", "n.txt")
35	h.C3 = f.Commit("third: type change")
36
37	f.CheckoutNew("feature/x")
38	f.Write("side.txt", "s\n")
39	h.Side = f.Commit("side work")
40	f.Checkout("main")
41	f.Write("main.txt", "m\n")
42	f.Commit("main work")
43	h.Merge = f.Merge("feature/x")
44
45	f.Git("tag", "v1", h.C1)
46	f.Git("tag", "-a", "-m", "release two", "v2", h.C2)
47	f.Git("tag", "-a", "-m", "tag of a tag", "v2-again", "v2")
48	f.Git("tag", "-a", "-m", "tag of a tree", "tree-tag", h.Merge+"^{tree}")
49	f.Git("branch", "release/1.0", h.C2)
50	f.Git("branch", "rel/1", h.C1)
51	f.Git("tag", "rel/1/x", h.C3)
52	return h
53}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
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
l h
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
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 3

Tags 43

↑↓ moveenter openesc close