Introduce postclone.sh script to ignore .pc/ dir.
authorJaromír Mikeš <mira.mikes@seznam.cz>
Tue, 15 Aug 2017 02:47:16 +0000 (04:47 +0200)
committerJaromír Mikeš <mira.mikes@seznam.cz>
Tue, 15 Aug 2017 02:47:16 +0000 (04:47 +0200)
debian/README.source
debian/gbp/postclone.sh [new file with mode: 0755]
debian/git-tuneclone.sh [deleted file]

index b216addb9622c093e9fcafa55fcc69f05c50674e..fcde71b949bb229d8b76d87ab89eb236a1c6b174 100644 (file)
@@ -17,20 +17,25 @@ Files stripped away are enumerated in the Files-Excluded stanza in
 debian/copyright.
 
 
-git-tuneclone.sh
-----------------
+gbp clone
+---------
 
-This package comes with a script 'debian/git-tuneclone.sh'.
-Running it after a fresh clone of the packaging repository
-will fine-tune your local copy, namely:
+Starting with gbp>0.8.1, here's an simple way to automatically fine-tune the
+repository in the following ways:
 - make git ignore any .pc/ directory (created by quilt)
-- enable the "-follow-tags" when running 'git-push', so it's harder
+- enable the "--follow-tags" when running 'git-push', so it's harder
   to forget to push packaging tags along with the branches.
-- do an initial checkout of the 3 packaging branches (master, pristine-tar,
-  upstream)
-The script only needs to run once (though running it multiple times shouldn't
-matter).
-You are of course free to *not* run the script, if you prefer.
 
- -- IOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org>  Tue, 11 Nov 2015 11:11:03 +0100
+To enable this, run gbp-clone with the '--postclone debian/gbp/postclone.sh'
+option.
+To enable this for ALL repositories cloned via 'gbp' (in the future), do
+something like the following:
 
+    $ mkdir -p ~/bin
+    $ cp debian/gbp/postclone.sh ~/bin/gbphook-postclone
+    $ cat >> ~/.gbp.conf <<EOF
+    [clone]
+    postclone = ~/bin/gbphook-postclone
+    EOF
+
+ -- IOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org>  Mon, 1 Aug 2016 12:15:50 +0200
diff --git a/debian/gbp/postclone.sh b/debian/gbp/postclone.sh
new file mode 100755 (executable)
index 0000000..5790ec6
--- /dev/null
@@ -0,0 +1,14 @@
+#!/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
+
+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/")
diff --git a/debian/git-tuneclone.sh b/debian/git-tuneclone.sh
deleted file mode 100755 (executable)
index 59ac8c6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/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/")
-
-for branch in pristine-tar upstream master; do
- git checkout "${branch}"
-done