code

Unnamed repository; edit this file 'description' to name the repository.
git clone https://code.literati.org/code.git
Log | Files | Refs | README | LICENSE

commit f25b1e55d5a08f9d82f33019b502a8bf35084bbc
parent f161c2561bb071576394132a677a887ab0a75521
Author: Sean Lynch <sean.lynch@netskope.com>
Date:   Thu, 10 Oct 2019 12:49:10 -0700

Move files around, fix make-new-repo, and update the README.

Diffstat:
MREADME.md | 28++++++++++++++++++++--------
Rstatic/favicon.png -> favicon.png | 0
Rstatic/logo.png -> logo.png | 0
Mmake-new-repo | 7+++++--
Rpost-update.hook -> post-update.m4 | 0
Rstatic/style.css -> style.css | 0
Aurl.m4 | 1+
7 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md @@ -1,13 +1,25 @@ # Generator for code.literati.org -To use this, first pick a directory where you want to generate the -HTML. Then create a bare repo to push the code into under that -directory using `make-new-repo <repo name>`. This will create a bare -repo named `<repo name>.git` and set up a post-update hook to make -that repo clonable over a "dumb transport" like http as well as -generate the index. It will also copy logo.png and style.css from the -same directory as make-new-repo into the destination directory for the -generated HTML, so replace those with your own if you want. +The purpose of this project is to allow serving Git repositories from +a static web server. To use it, clone this repo, then edit the file +"url.m4" to point at where you will be hosting the files. Leave REPO +as it is; that will be replaced with the name of each repository. + +Next, for each repository you want to serve code for, change to the +local copy of the directory that you want the repositories to be +hosted under and run `<clone dir>/make-new-repository <repo name>`. +This will create a bare repo named `<repo name>.git` that you can push +the code to and set up a post-update hook to make that repo clonable +over a "dumb transport" like http as well as generate the index. It +will also copy logo.png and style.css from the same directory as +make-new-repo into the destination directory for the generated HTML, +so replace those with your own if you want. + +Before pushing to the bare repo, edit the file "owner" in the root of +the repo to contain the name and email of the repo maintainer (I'd +recommend using a mailing list for group projects and accepting +patches that way). Edit "description" to be a short description of the +project. Add the newly created bare repo as a remote to your working copy, then push to it any time you want to update the HTML. Copy the files over diff --git a/static/favicon.png b/favicon.png Binary files differ. diff --git a/static/logo.png b/logo.png Binary files differ. diff --git a/make-new-repo b/make-new-repo @@ -1,11 +1,14 @@ #!/bin/sh +set -e scriptdir="$(dirname "$(realpath -se "$0")")" for repo in $@ do + reponame="$(basename "$repo")" git init --bare "$repo.git" hookdest="$repo.git/hooks/post-update" - m4 -D "SCRIPTDIR=$scriptdir" < "$scriptdir/post-update.hook" > "$hookdest" + m4 -D "SCRIPTDIR=$scriptdir" < "$scriptdir/post-update.m4" > "$hookdest" chmod +x "$hookdest" + m4 -D "REPO=$reponame" < "$scriptdir/url.m4" > "$repo.git/url" mkdir "$repo" - cp "$SCRIPTDIR/logo.png" "$SCRIPTDIR/style.css" "$repo" + cp "$scriptdir/logo.png" "$scriptdir/style.css" "$repo" done diff --git a/post-update.hook b/post-update.m4 diff --git a/static/style.css b/style.css diff --git a/url.m4 b/url.m4 @@ -0,0 +1 @@ +https://code.literati.org/REPO.git