stagit

static git page generator
git clone git://git.2f30.org/stagit.git
Log | Files | Refs | README | LICENSE

README (2492B)


      1 stagit
      2 ======
      3 
      4 static git page generator
      5 
      6 
      7 Usage
      8 -----
      9 
     10 Make files per repository:
     11 
     12 	$ mkdir -p htmldir && cd htmldir
     13 	$ stagit path-to-repo
     14 
     15 Make index file for repositories:
     16 
     17 	$ stagit-index repodir1 repodir2 repodir3 > index.html
     18 
     19 
     20 Install
     21 -------
     22 
     23 $ make
     24 # make install
     25 
     26 
     27 Dependencies
     28 ------------
     29 
     30 - libgit2 (v0.22+).
     31 - libc (tested with OpenBSD, FreeBSD, glibc and musl).
     32 - C compiler (C99).
     33 - make
     34 
     35 
     36 Documentation
     37 -------------
     38 
     39 See man pages: stagit(1) and stagit-index(1).
     40 
     41 
     42 Building a static binary
     43 ------------------------
     44 
     45 It may be useful to build static binaries, for example to run in a chroot.
     46 
     47 It can be done like this at the time of writing (v0.24):
     48 
     49 cd libgit2-src
     50 
     51 # change the options in the CMake file: CMakeLists.txt
     52 BUILD_SHARED_LIBS to OFF (static)
     53 CURL to OFF              (not needed)
     54 USE_SSH OFF              (not needed)
     55 THREADSAFE OFF           (not needed)
     56 USE_OPENSSL OFF          (not needed, use builtin)
     57 
     58 mkdir -p build && cd build
     59 cmake ../
     60 make
     61 make install
     62 
     63 
     64 Extract owner field from git config
     65 -----------------------------------
     66 
     67 A (hacky) way to extract the gitweb owner for example in the format:
     68 
     69 	[gitweb]
     70 		owner = Name here
     71 
     72 Script:
     73 
     74 	#!/bin/sh
     75 	awk '/^[ 	]*owner[ 	]=/ {
     76 		sub(/^[^=]*=[ 	]*/, "");
     77 		print $0;
     78 	}'
     79 
     80 
     81 Features
     82 --------
     83 
     84 - Log of all commits from HEAD.
     85 - Log and diffstat per commit.
     86 - Show file tree with linkable line numbers.
     87 - Show references: local branches and tags.
     88 - Detect README and LICENSE file from HEAD and link it as a webpage.
     89 - Detect submodules (.gitmodules file) from HEAD and link it as a webpage.
     90 - Atom feed log (atom.xml).
     91 - Make index page for multiple repositories with stagit-index.
     92 - After generating the pages (relatively slow) serving the files is very fast,
     93   simple and requires little resources (because the content is static), only
     94   a HTTP file server is required.
     95 - Usable with text-browsers such as dillo, links, lynx and w3m.
     96 
     97 
     98 Cons
     99 ----
    100 
    101 - Not suitable for large repositories (2000+ commits), because diffstats are
    102   an expensive operation.
    103 - Not suitable for repositories with many branches, a quite linear history is
    104   assumed (from HEAD).
    105 - Relatively slow to run the first time (about 3 seconds for sbase,
    106   1500+ commits), incremental updates are faster.
    107 - Does not support some of the dynamic features cgit has, like:
    108   - snapshot tarballs.
    109   - file tree per commit.
    110   - history log of branches diverged from HEAD.
    111   - stats (git shortlog -s).
    112 
    113   this is by design, just use git locally.