stagit

static git page generator  https://git.ce9e.org
git clone https://git.ce9e.org/stagit.git

commit
012fde8a61202aec1aba8be629e083fc1a8a3cd2
parent
da60fa023abe83254fcb031129bc4926496f5e78
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-03-29 19:06
rm unused files

Diffstat

D example_create.sh 43 -------------------------------------------
D example_post-receive.sh 73 ------------------------------------------------------------
D favicon.png 0
D logo.png 0
D stagit.1 107 ------------------------------------------------------------

5 files changed, 0 insertions, 223 deletions


diff --git a/example_create.sh b/example_create.sh

@@ -1,43 +0,0 @@
    1    -1 #!/bin/sh
    2    -1 # - Makes index for repositories in a single directory.
    3    -1 # - Makes static pages for each repository directory.
    4    -1 #
    5    -1 # NOTE, things to do manually (once) before running this script:
    6    -1 # - copy style.css, logo.png and favicon.png manually, a style.css example
    7    -1 #   is included.
    8    -1 #
    9    -1 # - write clone url, for example "git://git.codemadness.org/dir" to the "url"
   10    -1 #   file for each repo.
   11    -1 # - write owner of repo to the "owner" file.
   12    -1 # - write description in "description" file.
   13    -1 #
   14    -1 # Usage:
   15    -1 # - mkdir -p htmldir && cd htmldir
   16    -1 # - sh example_create.sh
   17    -1 
   18    -1 # path must be absolute.
   19    -1 reposdir="/var/www/domains/git.codemadness.nl/home/src"
   20    -1 curdir="$(pwd)"
   21    -1 
   22    -1 # make index.
   23    -1 stagit-index "${reposdir}/"*/ > "${curdir}/index.html"
   24    -1 
   25    -1 # make files per repo.
   26    -1 for dir in "${reposdir}/"*/; do
   27    -1 	# strip .git suffix.
   28    -1 	r=$(basename "${dir}")
   29    -1 	d=$(basename "${dir}" ".git")
   30    -1 	printf "%s... " "${d}"
   31    -1 
   32    -1 	mkdir -p "${curdir}/${d}"
   33    -1 	cd "${curdir}/${d}" || continue
   34    -1 	stagit -c ".cache" "${reposdir}/${r}"
   35    -1 
   36    -1 	# symlinks
   37    -1 	ln -sf log.html index.html
   38    -1 	ln -sf ../style.css style.css
   39    -1 	ln -sf ../logo.png logo.png
   40    -1 	ln -sf ../favicon.png favicon.png
   41    -1 
   42    -1 	echo "done"
   43    -1 done

diff --git a/example_post-receive.sh b/example_post-receive.sh

@@ -1,73 +0,0 @@
    1    -1 #!/bin/sh
    2    -1 # generic git post-receive hook.
    3    -1 # change the config options below and call this script in your post-receive
    4    -1 # hook or symlink it.
    5    -1 #
    6    -1 # usage: $0 [name]
    7    -1 #
    8    -1 # if name is not set the basename of the current directory is used,
    9    -1 # this is the directory of the repo when called from the post-receive script.
   10    -1 
   11    -1 # NOTE: needs to be set for correct locale (expects UTF-8) otherwise the
   12    -1 #       default is LC_CTYPE="POSIX".
   13    -1 export LC_CTYPE="en_US.UTF-8"
   14    -1 
   15    -1 name="$1"
   16    -1 if test "${name}" = ""; then
   17    -1 	name=$(basename "$(pwd)")
   18    -1 fi
   19    -1 
   20    -1 # config
   21    -1 # paths must be absolute.
   22    -1 reposdir="/home/src/src"
   23    -1 dir="${reposdir}/${name}"
   24    -1 htmldir="/home/www/domains/git.codemadness.org/htdocs"
   25    -1 stagitdir="/"
   26    -1 destdir="${htmldir}${stagitdir}"
   27    -1 cachefile=".htmlcache"
   28    -1 # /config
   29    -1 
   30    -1 if ! test -d "${dir}"; then
   31    -1 	echo "${dir} does not exist" >&2
   32    -1 	exit 1
   33    -1 fi
   34    -1 cd "${dir}" || exit 1
   35    -1 
   36    -1 # detect git push -f
   37    -1 force=0
   38    -1 while read -r old new ref; do
   39    -1 	test "${old}" = "0000000000000000000000000000000000000000" && continue
   40    -1 	test "${new}" = "0000000000000000000000000000000000000000" && continue
   41    -1 
   42    -1 	hasrevs=$(git rev-list "${old}" "^${new}" | sed 1q)
   43    -1 	if test -n "${hasrevs}"; then
   44    -1 		force=1
   45    -1 		break
   46    -1 	fi
   47    -1 done
   48    -1 
   49    -1 # strip .git suffix.
   50    -1 r=$(basename "${name}")
   51    -1 d=$(basename "${name}" ".git")
   52    -1 printf "[%s] stagit HTML pages... " "${d}"
   53    -1 
   54    -1 mkdir -p "${destdir}/${d}"
   55    -1 cd "${destdir}/${d}" || exit 1
   56    -1 
   57    -1 # remove commits and ${cachefile} on git push -f, this recreated later on.
   58    -1 if test "${force}" = "1"; then
   59    -1 	rm -f "${cachefile}"
   60    -1 	rm -rf "commit"
   61    -1 fi
   62    -1 
   63    -1 # make index.
   64    -1 stagit-index "${reposdir}/"*/ > "${destdir}/index.html"
   65    -1 
   66    -1 # make pages.
   67    -1 stagit -c "${cachefile}" "${reposdir}/${r}"
   68    -1 
   69    -1 ln -sf log.html index.html
   70    -1 ln -sf ../style.css style.css
   71    -1 ln -sf ../logo.png logo.png
   72    -1 
   73    -1 echo "done"

diff --git a/favicon.png b/favicon.png

Binary files differ.

diff --git a/logo.png b/logo.png

Binary files differ.

diff --git a/stagit.1 b/stagit.1

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