-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcgit-init
More file actions
executable file
·32 lines (24 loc) · 833 Bytes
/
cgit-init
File metadata and controls
executable file
·32 lines (24 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
BASE=$(dirname `readlink -f $0`)
REPO_BASE=$(readlink -m "${CGIT_REPO:-/root/.cgit}")
REPO_DIR="$REPO_BASE/.git"
TREE=${CGIT_TREE:-"/"}
export GIT_DIR=$REPO_DIR
export GIT_WORK_TREE=$TREE
if [ -e "$REPO_DIR" ];
then
echo "Repository dir not empty, aborting."
exit 1
fi
mkdir -p "$REPO_BASE"
git init --template="$BASE/template"
git config --add alias.store-meta "!`git rev-parse --git-dir`/hooks/setgitperms.perl -r"
git config --add alias.apply-meta "!`git rev-parse --git-dir`/hooks/setgitperms.perl -w"
git config --add alias.smeta "!`git rev-parse --git-dir`/hooks/setgitperms.perl -r"
git config --add alias.ameta "!`git rev-parse --git-dir`/hooks/setgitperms.perl -w"
git store-meta
# git store-meta
git commit -F-<<EOF
Initial commit.
Initialize the config repo and add the meta-tracking file.
EOF