+++ /dev/null
-#!/bin/sh
-#
-# func/gitpub
-#
-# a convenient way to publicise a Git repository
-#
-# Copyright © 2008–2009 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-local oldpwd gitdir dest description tmpdir
-oldpwd="$PWD"
-gitdir="$(git rev-parse --git-dir)"
-dest="$1"; shift
-description="$@"
-tmpdir="$(mktemp -d ${0##*/}.XXXXXX)"
-trap "rm -rf $PWD/$tmpdir" EXIT
-
-cp -lr "$gitdir" "$tmpdir/gitdir"
-
-builtin cd "$tmpdir/gitdir"
-
-chmod -R a+rX .
-
-git config core.bare true
-git config core.sharedrepository 2
-git config receive.denyNonFastforwards true
-
-echo "$description" >| description
-
-cd "$oldpwd"
-
-scp -r "$tmpdir/gitdir" "$dest"
+++ /dev/null
-#!/bin/sh
-#
-# func/giturl
-#
-# A convenient way to display the gitweb URL of a commit-ish, as well as the
-# base URL and tree. Also for each argument, the tree or blob URL is printed.
-#
-# Copyright © 2010 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-# Contributions from Yaroslav O. Halchenko <debian@onerussian.com>
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-local branch remote remote_name
-branch=$(git symbolic-ref -q HEAD); branch="${branch#refs/heads/}"
-# Obtain remote which current branch tracks, origin if not known
-remote_name=$(git config branch.$branch.remote || echo origin)
-remote=$(git config --get remote.$remote_name.url)
-
-local part gitweb_base style commitkw
-style=gitweb
-commitkw=commitdiff # keyword for commit -- differ for github
-argssep=: # separator for arguments of the query
-case "$remote" in
- madduck:pub/*|ssh://git.madduck.net/madduck/pub/*)
- gitweb_base=http://git.madduck.net/v
- part="${remote#madduck:pub/}"
- part="${part#ssh://git.madduck.net/madduck/pub/}"
- part="${part%.git}.git"
- ;;
- debian:*|*://git.debian.org/git/*|*://alioth.debian.org/git/*|*@git.debian.org/git/*)
- gitweb_base=http://git.debian.org
- part="${remote#debian:}"
- part="${part#*://git.debian.org/git/}"
- part="${part#*://alioth.debian.org/git/}"
- part="${part#*@git.debian.org/git/}"
- part="${part%.git}.git"
- style=gitweb_old
- ;;
- github:*|*://github.com/*|*@github.com[/:]*)
- gitweb_base=http://github.com
- part="${remote#github:}"
- part="${part#*://github.com/}"
- part="${part#*@github.com[:/]}"
- part="${part%.git}"
- style=github
- commitkw=commit
- argssep=
- ;;
- *)
- echo >&2 "E: I do not know how to translate $remote into a gitweb URL."
- return 1
- ;;
-esac
-
-local hash
-hash=$(git rev-parse HEAD)
-
-case "$style" in
- gitweb|github)
- echo "$gitweb_base/$part"
- echo "$gitweb_base/$part/$commitkw/$hash"
- echo "$gitweb_base/$part/tree/HEAD"
- for i in $@; do
- [ -f "$i" ] && echo "$gitweb_base/$part/blob/HEAD${argssep}/$i"
- [ -d "$i" ] && echo "$gitweb_base/$part/tree/HEAD${argssep}/$i"
- done
- ;;
- gitweb_old)
- echo "$gitweb_base/?p=$part"
- echo "$gitweb_base/?p=$part;a=commitdiff;h=$hash"
- echo "$gitweb_base/?p=$part;a=tree;h=HEAD"
- for i in $@; do
- [ -f "$i" ] && echo "$gitweb_base/?p=$part;a=blob;hb=HEAD;f=$i"
- [ -d "$i" ] && echo "$gitweb_base/?p=$part;a=tree;hb=HEAD;f=$i"
- done
- ;;
-esac
+++ /dev/null
-#!/bin/sh
-set -u
-
-if [ -n "${ZSH_VERSION:-}" ]; then
- # don't execute trap on return from functions
- setopt local_options posix_traps no_warn_create_global
-fi
-
-RESOURCE=idiotheke.de
-PASSWORD="$(pass $RESOURCE)"
-LOGIN="$(echo "$PASSWORD" | sed -rne 's/login: //p')"
-URL="$(echo "$PASSWORD" | sed -rne 's/url: //p')"
-PASSWORD="${PASSWORD%%
-*}" #first line only
-
-if [ -n "${1:-}" ]; then
- ASKPASS="$(tempfile --prefix=askpass --mode=700)"
- cleanup() { rm -f $ASKPASS; trap - 0; }
- trap cleanup 0
-
- echo '#!/bin/sh' >> $ASKPASS
- echo "echo ${LOGIN}:${PASSWORD}" >> $ASKPASS
-
- wget --continue --use-askpass="$ASKPASS" "$@"
-
- cleanup
- ! command -v unfunction >/dev/null || unfunction cleanup
-else
- LFTP_PASSWORD="$PASSWORD" lftp -e "open -u $LOGIN --env-password $URL"
-fi
-
-unset RESOURCE LOGIN PASSWORD URL ASKPASS
+++ /dev/null
-#!/bin/zsh
-#
-# func/p
-#
-# function to publish to a pastebin (using pastebinit)
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-if [[ $# -gt 1 ]]; then
- echo E: only one argument can be passed. >&2
- exit 1
-fi
-
-PERMATAG=$USER
-PB=http://slexy.org
-PBIT="pastebinit -b $PB -a $USER"
-
-FILE=-
-[[ -n "$1" ]] && FILE="$1"
-
-eval $PBIT -i $FILE | sed -e s@/view/@/raw/@
+++ /dev/null
-#!/bin/sh
-#
-# func/svngit
-#
-# one-time conversion of SVN repositories to Git repositories
-#
-# Copyright © 2006–2009 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-local svnrepo dest args
-args=()
-
-for arg in "$@"; do
- case "$arg" in
- (svn+*|svn://|http://)
- if [[ -z $svnrepo ]]; then
- svnrepo="$arg"
- else
- echo "E: SVN repository multiply defined." >&2
- exit 1
- fi
- ;;
- (*)
- if [[ -e $dest ]]; then
- if [[ -d $dest ]] && [[ -z $svnrepo ]] && svn info $svnrepo >/dev/null 2>&1; then
- svnrepo="$arg"
- else
- echo "E: destination $dest already exists." >&2
- exit 1
- fi
- fi
- if [[ -z $dest ]]; then
- dest="$arg"
- else
- args+="$arg"
- fi
- ;;
- esac
-done
-
-git svn clone --no-metadata $args "$svnrepo" "$dest"
-
-cd "$dest/.git"
-
-test -d svn && rm -r svn
-rm -rf **/git-svn*
-
-cd -
+++ /dev/null
-#!/bin/zsh
-#
-# func/urlencode
-#
-# encode strings for use with URLs
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-# Based on http://www.michael-prokop.at/computer/config/.zshrc
-
-setopt localoptions extendedglob
-input=( ${(s::)1} )
-print ${(j::)input/(#b)([^A-Za-z0-9_.!~*\'\(\)-])/%$(([##16]#match))}