Skip to content
Snippets Groups Projects
Commit 84a9200b authored by Richard Hartmann's avatar Richard Hartmann
Browse files

Automate handling of .gitignore.d/$REPO_NAME

excludesfile = .gitignore.d/$REPO_NAME is set on

* init
* clone
* seed-gitignore
parent 001cf886
Branches
Tags v0.20111118
No related merge requests found
...@@ -75,6 +75,7 @@ init() { ...@@ -75,6 +75,7 @@ init() {
cd "$GIT_WORK_TREE" cd "$GIT_WORK_TREE"
git init git init
git config core.worktree "$GIT_WORK_TREE" git config core.worktree "$GIT_WORK_TREE"
git config core.excludesfile ".gitignore.d/$REPO_NAME"
verbose "init() end" verbose "init() end"
} }
...@@ -137,6 +138,7 @@ elif [ "$1" = 'clone' ]; then ...@@ -137,6 +138,7 @@ elif [ "$1" = 'clone' ]; then
git remote add origin "$GIT_REMOTE" git remote add origin "$GIT_REMOTE"
git config branch.master.remote origin git config branch.master.remote origin
git config branch.master.merge refs/heads/master git config branch.master.merge refs/heads/master
git config core.excludesfile ".gitignore.d/$REPO_NAME"
git fetch git fetch
for object in $(git ls-tree -r origin/master | awk '{print $4}'); do for object in $(git ls-tree -r origin/master | awk '{print $4}'); do
[ -e "$object" ] && [ -e "$object" ] &&
...@@ -175,6 +177,7 @@ elif [ "$1" = 'seed-gitignore' ]; then ...@@ -175,6 +177,7 @@ elif [ "$1" = 'seed-gitignore' ]; then
verbose "seed-gitignore begin" verbose "seed-gitignore begin"
[ -z $2 ] && help && echo && echo "$SELF $1: please specify repository to work on" && return 0 [ -z $2 ] && help && echo && echo "$SELF $1: please specify repository to work on" && return 0
use "$2" use "$2"
git config core.excludesfile ".gitignore.d/$REPO_NAME"
files=$(git ls-files) files=$(git ls-files)
gitignores=$(for file in $(git ls-files); do gitignores=$(for file in $(git ls-files); do
while true; do while true; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment