1# vi: set ft=conf
 2
 3# convert crlf to lf on windows
 4[windows] dos2unix blob1.txt blob2.txt blob3.txt
 5
 6# create a repo
 7soft repo create repo1
 8
 9# clone repo
10git clone ssh://localhost:$SSH_PORT/repo1 repo1
11
12# create some files, commits, tags...
13mkfile ./repo1/README.md '# Hello\n\nwelcome'
14mkfile ./repo1/main.go 'package main\nconst foo = 2\n'
15mkfile ./repo1/.hidden ''
16mkdir ./repo1/folder
17mkdir ./repo1/.folder
18mkfile ./repo1/folder/lib.c '//#include <stdio.h>'
19git -C repo1 add -A
20git -C repo1 commit -m 'first'
21git -C repo1 push origin HEAD
22
23# print root blob
24soft repo blob repo1 README.md
25cmp stdout blob1.txt
26
27# print file blob with revision with line numbers and colors
28soft repo blob repo1 master main.go -l -c
29cmp stdout blob2.txt
30
31
32# print file blob with revision within folder with lineno
33soft repo blob repo1 master folder/lib.c -l
34cmp stdout blob3.txt
35
36# print blob of folder that does not exist
37! soft repo blob repo1 folder/nope.txt
38! stdout .
39stderr 'revision does not exist'
40
41# print blob of bad revision
42! soft repo blob repo1 badrev README.md
43! stdout .
44stderr 'revision does not exist'
45
46-- blob1.txt --
47# Hello\n\nwelcome
48-- blob2.txt --
49 [38;5;239m1[0m [38;5;236m│[0m [38;5;204m[0m[38;5;204mpackage[0m main[38;5;255m\[0mnconst foo [38;5;187m=[0m [38;5;85m2[0m[38;5;255m\[0mn
50-- blob3.txt --
51 1 │ //#include <stdio.h>