stagit.1 (3601B) [raw]
1 .Dd August 2, 2021 2 .Dt STAGIT 1 3 .Os 4 .Sh NAME 5 .Nm stagit 6 .Nd static git page generator 7 .Sh SYNOPSIS 8 .Nm 9 .Op Fl c Ar cachefile 10 .Op Fl l Ar commits 11 .Op Fl u Ar baseurl 12 .Op Fl r Ar rooturl 13 .Ar repodir 14 .Sh DESCRIPTION 15 .Nm 16 writes HTML pages for the repository 17 .Ar repodir 18 to the current directory. 19 .Pp 20 The options are as follows: 21 .Bl -tag -width Ds 22 .It Fl c Ar cachefile 23 Cache the entries of the log page up to the point of 24 the last commit. 25 The 26 .Ar cachefile 27 will store the last commit id and the entries in the HTML table. 28 It is up to the user to make sure the state of the 29 .Ar cachefile 30 is in sync with the history of the repository. 31 .It Fl l Ar commits 32 Write a maximum number of 33 .Ar commits 34 to the log.html file only. 35 However the commit files are written as usual. 36 .It Fl u Ar baseurl 37 Base URL to make links in the Atom feeds absolute. 38 For example: "https://git.codemadness.org/stagit/". 39 .It Fl r Ar rooturl 40 Root URL to link to for the logo. 41 Defaults to "..". 42 .El 43 .Pp 44 The options 45 .Fl c 46 and 47 .Fl l 48 cannot be used at the same time. 49 .Pp 50 The following files will be written: 51 .Bl -tag -width Ds 52 .It atom.xml 53 Atom XML feed of the last 100 commits. 54 .It tags.xml 55 Atom XML feed of the tags. 56 .It files.html 57 List of files in the latest tree, linking to the file. 58 .It log.html 59 List of commits in reverse chronological applied commit order, each commit 60 links to a page with a diffstat and diff of the commit. 61 .It refs.html 62 Lists references of the repository such as branches and tags. 63 .El 64 .Pp 65 For each entry in HEAD a file will be written in the format: 66 file/filepath.html. 67 This file will contain the textual data of the file prefixed by line numbers. 68 The file will have the string "Binary file" if the data is considered to be 69 non-textual. 70 .Pp 71 For each commit a file will be written in the format: 72 commit/commitid.html. 73 This file will contain the diffstat and diff of the commit. 74 It will write the string "Binary files differ" if the data is considered to 75 be non-textual. 76 Too large diffs will be suppressed and a string 77 "Diff is too large, output suppressed" will be written. 78 .Pp 79 When a commit HTML file exists it won't be overwritten again, note that if 80 you've changed 81 .Nm 82 or changed one of the metadata files of the repository it is recommended to 83 recreate all the output files because it will contain old data. 84 To do this remove the output directory and 85 .Ar cachefile , 86 then recreate the files. 87 .Pp 88 The basename of the directory is used as the repository name. 89 The suffix ".git" is removed from the basename, this suffix is commonly used 90 for "bare" repos. 91 .Pp 92 The content of the follow files specifies the metadata for each repository: 93 .Bl -tag -width Ds 94 .It .git/description or description (bare repo). 95 description 96 .It .git/owner or owner (bare repo). 97 owner of repository 98 .It .git/url or url (bare repo). 99 primary clone URL of the repository, for example: 100 git://git.codemadness.org/stagit 101 .El 102 .Pp 103 When a README or LICENSE file exists in HEAD or a .gitmodules submodules file 104 exists in HEAD a direct link in the menu is made. 105 .Pp 106 For changing the style of the page you can use the following files: 107 .Bl -tag -width Ds 108 .It favicon.png 109 favicon image. 110 .It logo.png 111 32x32 logo. 112 .It style.css 113 CSS stylesheet. 114 .El 115 .Sh EXIT STATUS 116 .Ex -std 117 .Sh EXAMPLES 118 .Bd -literal 119 mkdir -p htmlroot/htmlrepo1 && cd htmlroot/htmlrepo1 120 stagit path/to/gitrepo1 121 # repeat for other repositories. 122 .Ed 123 .Pp 124 To update the HTML files when the repository is changed a git post-receive hook 125 can be used, see the file example_post-receive.sh for an example. 126 .Sh SEE ALSO 127 .Xr stagit-index 1 128 .Sh AUTHORS 129 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org