All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
5 # set the context for vcs-home operations
7 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
8 # Released under the terms of the Artistic Licence 2.0
10 # Source repository: git://git.madduck.net/etc/zsh.git
13 local FGIT_BASE="$HOME/.fgits"
17 for i in $FGIT_BASE/*.git
23 elif [[ "$1" == '-c' ]]
29 echo "E: no repository name given" >&2
32 if [[ -e "$FGIT_BASE/${1}.git" ]]
34 echo "E: repository '$1' still exists" >&2
38 git init --bare "$FGIT_BASE/${1}.git"
39 cd "$FGIT_BASE/${1}.git"
40 git config core.bare false
41 git config core.worktree ../../
42 git config core.excludesfile "$FGIT_BASE/${1}.ignore"
45 [[ -e "$FGIT_BASE/${1}.ignore" ]] || echo "/*" > "$FGIT_BASE/${1}.ignore"
47 if [[ "${1:---help}" == '--help' ]] || [[ $# -gt 1 ]]
49 echo "usage: ${0##*/} reponame" >&2
50 echo "usage: ${0##*/} -l" >&2
51 echo "usage: ${0##*/} -c reponame" >&2
56 if [ ! -d "$FGIT_BASE/${1}.git" ]; then
57 echo E: no repository found for "$1" >&2
61 old_GIT_DIR="${GIT_DIR:-}"
62 old_GIT_WORK_TREE="${GIT_WORK_TREE:-}"
64 export GIT_DIR="$FGIT_BASE/${1}.git"
65 export GIT_WORK_TREE="$GIT_DIR/$(git config --get core.worktree)"
67 PS1="%S{${0##*/}:$1}%s$PS1" $SHELL -i || :
69 GIT_DIR="$old_GIT_DIR"
70 [ -z "$GIT_DIR" ] && unset GIT_DIR
71 GIT_WORK_TREE="$old_GIT_WORK_TREE"
72 [ -z "$GIT_WORK_TREE" ] && unset GIT_WORK_TREE