STAGIT-GOPHER(1)

NAME
stagit-gopher - static git Gopher index generator

SYNOPSIS
stagit-gopher [-b baseprefix] [-c cachefile] [-l commits] [-u baseurl] repodir

DESCRIPTION
stagit-gopher writes Gopher indexes for the repository repodir to the current directory.

The options are as follows:

-b baseprefix
    Use base prefix as the root. By default this is "".

-c cachefile
    Cache the entries of the log index up to the point of the last commit. The cachefile will store the last commit id and the entries in the Gopher index. It is up to the user to make sure the state of the cachefile is in sync with the history of the repository.

-l commits
    Write a maximum number of commits to the log.gph file only. However the commit files are written as usual.

-u baseurl
    Base URL to make links in the Atom feeds absolute. Does not use the prefix from the -b option. It should include the gopher type. For example: "gopher://codemadness.org/1/git/stagit-gopher/".

The options -c and -l cannot be used at the same time.

The following files will be written:

atom.xml
    Atom XML feed of the last 100 commits.

tags.xml
    Atom XML feed of the tags.

files.gph
    List of files in the latest tree, linking to the file.

log.gph
    List of commits in reverse chronological applied commit order, each commit links to a page with a diffstat and diff of the commit.

refs.gph
    Lists references of the repository such as branches and tags.

For each entry in HEAD a file will be written in the format: file/filepath.gph. This file will contain the textual data of the file prefixed by line numbers. The file will have the string "Binary file" if the data is considered to be non-textual.

For each commit a file will be written in the format: commit/commitid.gph. This file will contain the diffstat and diff of the commit. It will write the string "Binary files differ" if the data is considered to be non-textual. Too large diffs will be suppressed and a string "Diff is too large, output suppressed" will be written.

When a Gopher commit file exists it won't be overwritten again, note that if you've changed stagit-gopher or changed one of the metadata files of the repository it is recommended to recreate all the output files because it will contain old data. To do this remove the output directory and cachefile, then recreate the files.

The basename of the directory is used as the repository name. The suffix ".git" is removed from the basename, this suffix is commonly used for "bare" repos.

The content of the follow files specifies the metadata for each repository:

.git/description or description (bare repo).
    description

.git/url or url (bare repo).
    primary clone URL of the repository, for example: git://git.codemadness.org/stagit

When a README or LICENSE file exists in HEAD or a .gitmodules submodules file exists in HEAD a direct link in the index is made.

EXIT STATUS

EXAMPLES

    mkdir -p gphroot/gphrepo1 && cd gphroot/gphrepo1
    stagit-gopher path/to/gitrepo1
    # repeat for other repositories.

To update the gph files when the repository is changed a git post-receive hook can be used, see the file example_post-receive.sh for an example.

SEE ALSO
stagit-gopher-index(1)

AUTHORS
Hiltjo Posthuma <hiltjo@codemadness.org>