File: git-tuneclone.sh

package info (click to toggle)
pd-creb 0.10.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,728 kB
  • sloc: ansic: 5,424; cpp: 1,197; makefile: 138; sh: 25
file content (37 lines) | stat: -rwxr-xr-x 989 bytes parent folder | download | duplicates (6)
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
33
34
35
36
37
#!/bin/sh

## script to initialize a cloned repository
## with per (local) repository settings.

# - ignore quilt's .pc/ directory
# - enable the "--follow-tags" mode for pushing

error() {
 echo "$@" 1>&2
}

NAME=$(dpkg-parsechangelog -S Source)

if [ "x${NAME}" = "x" ]; then
 error "unable to determine package name"
 error "make sure you run this script within a source package dir"
 exit 1
fi

if [ ! -d ".git" ]; then
 error "it seems like this source package is not under git control"
 exit 1
fi

echo "tuning git-repository for ${NAME}"
git config push.followTags true && echo "enabled push.followTags"

GITEXCLUDE=".git/info/exclude"
egrep "^/?\.pc/?$" "${GITEXCLUDE}" >/dev/null 2>&1 \
  || (echo "/.pc/" >> "${GITEXCLUDE}" && echo "ignoring /.pc/")
egrep "^/?autom4te\.cache/?$" "${GITEXCLUDE}" >/dev/null 2>&1 \
  || (echo "/autom4te.cache/" >> "${GITEXCLUDE}" && echo "ignoring /autom4te.cache/")

for branch in pristine-tar upstream master; do
 git checkout "${branch}"
done