dot

packages and services management
Log | Files | Refs | README

commit 96d9e4fdd41af80da904e9fcb3e3db2307470566
parent f1843c85156098300b073c05bf8661524b3b3886
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 16 Feb 2018 15:55:42 +0100

git-gopher directly in ~/srv

Diffstat:
Dbin/git-gopher | 28----------------------------
Mconfigure | 12++++++------
2 files changed, 6 insertions(+), 34 deletions(-)

diff --git a/bin/git-gopher b/bin/git-gopher @@ -1,28 +0,0 @@ -#!/bin/sh -# add index.gph and commit/%H.txt inside of a git bare repository -# usage: cd "$REPO_DIR" && git-index absolute/path/to/bare/repo.git - -p=$(printf '%s/commit/' "$1" | sed 's/[\&/]/\\&/g') -cat << EOF > index.gph - ---- $(basename "$(pwd)") --- - - git clone git://josuah.net:9000/$(basename "$PWD") - -$(git ls-tree -r --name-only master | sort | sed 's/^/ /') - -$(git log --graph --all --date=short --decorate --tags --branches --remotes \ - --format='%H %ad %an <%ae>%n %s%n' | sed -r ' - /[0-9a-f]{40}/ { - s/\|/\\&/g -s/(.*)([0-9a-f]{8})([0-9a-f]{32})(.*)/[0|\1\2\4|'"$p"'\2\3.txt|server|port]/ -}') -EOF - -mkdir -p commit -for commit in $(git log --format=%H) -do - [ -f "commit/$commit.txt" ] && continue - printf '%s\n' "$commit" 1>&2 - git show --stat -U3 "$commit" > "commit/$commit.txt" -done diff --git a/configure b/configure @@ -4,12 +4,12 @@ cd "$0/.." . ./.profile find . -path './.*' -prune \ - -o -type d -exec mkdir -p "${ETC}/{}" \; \ - -o -type f -exec ln -sf "${PWD}/{}" "${ETC}/{}" \; + -o -type d -exec mkdir -p "$ETC/{}" \; \ + -o -type f -exec ln -sf "$PWD/{}" "$ETC/{}" \; find .* -name .git -prune -o -name . -prune -o -name .. -prune \ - -o -type d -exec mkdir -p "${HOME}/{}" \; \ - -o -type f -exec ln -sf "${PWD}/{}" "${HOME}/{}" \; \ - -o -type l -exec ln -sf "${PWD}/{}" "${HOME}/{}" \; + -o -type d -exec mkdir -p "$HOME/{}" \; \ + -o -type f -exec ln -sf "$PWD/{}" "$HOME/{}" \; \ + -o -type l -exec ln -sf "$PWD/{}" "$HOME/{}" \; -find -L "${HOME}" -maxdepth 2 -type l -exec rm {} + +find -L "$HOME" -maxdepth 2 -type l -exec rm {} +