4 ODOO=https://github.com/odoo/odoo.git
5 DEV=https://github.com/odoo-dev/odoo.git
9 Usage: $0 [-m] [COPYNAME]
11 Checks out and sets up the Odoo git repository for "internal" development.
13 * Checks out the "production" repository (production branches) as the "odoo"
15 * Checks out the "development" repository (for employee development branches)
16 as the "dev" repository
18 By default, the working copy is "odoo"
21 -h displays this help text
22 -m includes github's merge refs. These are the pull requests to "odoo"
23 which merge cleanly into the main repository, after having applied
24 them to said repository
48 # Collect basic configuration data, ensures correct configuration of that repo
49 printf "Enter your full name: "
51 printf "Enter your (work) email: "
54 # create & set up repo
58 git config user.name "$name"
59 git config user.email "$email"
61 # pre-push script preventing push to odoo repo by default. Git just execs
62 # them, so they need a correct shebang and exec bit
63 # if things get more extensive, should probably use git init templates
64 cat <<EOF > .git/hooks/pre-push
69 if [ "\$url" != "$ODOO" ]
74 echo "Pushing to the odoo remote ($ODOO) is forbidden, push to the dev remote"
76 echo "See git help push if you really want to push to odoo"
80 chmod +x .git/hooks/pre-push
82 # add basic repos as remotes
83 git remote add odoo $ODOO
84 git remote add dev $DEV
88 git remote add merge $ODOO
89 git config remote.merge.fetch '+refs/pull/*/merge:refs/remotes/merge/*'