Added debian/git-tuneclone.sh script
run the script in a freshly checked out repository for fine-tuning
IOhannes m zmölnig
8 years ago
0 | #!/bin/sh | |
1 | ||
2 | ## script to initialize a cloned repository | |
3 | ## with per (local) repository settings. | |
4 | ||
5 | # - ignore quilt's .pc/ directory | |
6 | # - enable the "--follow-tags" mode for pushing | |
7 | ||
8 | error() { | |
9 | echo "$@" 1>&2 | |
10 | } | |
11 | ||
12 | NAME=$(dpkg-parsechangelog -S Source) | |
13 | ||
14 | if [ "x${NAME}" = "x" ]; then | |
15 | error "unable to determine package name" | |
16 | error "make sure you run this script within a source package dir" | |
17 | exit 1 | |
18 | fi | |
19 | ||
20 | if [ ! -d ".git" ]; then | |
21 | error "it seems like this source package is not under git control" | |
22 | exit 1 | |
23 | fi | |
24 | ||
25 | echo "tuning git-repository for ${NAME}" | |
26 | git config push.followTags true && echo "enabled push.followTags" | |
27 | ||
28 | GITEXCLUDE=".git/info/exclude" | |
29 | egrep "^/?\.pc/?$" "${GITEXCLUDE}" >/dev/null 2>&1 \ | |
30 | || (echo "/.pc/" >> "${GITEXCLUDE}" && echo "ignoring /.pc/") | |
31 | ||
32 | for branch in pristine-tar upstream master; do | |
33 | git checkout "${branch}" | |
34 | done |