Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
26230110
Commit
26230110
authored
10 years ago
by
Xavier Morel
Browse files
Options
Downloads
Patches
Plain Diff
[ADD] easy-setup script for employees
and others, but mostly employees
parent
8d2afb02
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
checkout.sh
+98
-0
98 additions, 0 deletions
checkout.sh
with
98 additions
and
0 deletions
checkout.sh
0 → 100755
+
98
−
0
View file @
26230110
#/bin/sh
set
-e
ODOO
=
https://github.com/odoo/odoo.git
DEV
=
https://github.com/odoo-dev/odoo.git
usage
()
{
cat
<<
EOF
Usage:
$0
[-m] [COPYNAME]
Checks out and sets up the Odoo git repository for "internal" development.
* Checks out the "production" repository (production branches) as the "odoo"
remote
* Checks out the "development" repository (for employee development branches)
as the "dev" repository
By default, the working copy is "odoo"
Options:
-h displays this help text
-m includes github's merge refs. These are the pull requests to "odoo"
which merge cleanly into the main repository, after having applied
them to said repository
EOF
}
while
getopts
:hm opt
do
case
$opt
in
h
)
usage
exit
0
;;
m
)
include_merge
=
yes
;;
*
)
usage
exit
1
;;
esac
done
shift
$((
OPTIND-1
))
copyname
=
${
1
:-
"odoo"
}
# Collect basic configuration data, ensures correct configuration of that repo
printf
"Enter your full name: "
read
name
printf
"Enter your (work) email: "
read
email
# create & set up repo
git init
$copyname
cd
$copyname
git config user.name
"
$name
"
git config user.email
"
$email
"
for
key
in
branch diff interactive status
;
do
git config
--global
color.
$key
auto
done
# pre-push script preventing push to odoo repo by default. Git just execs
# them, so they need a correct shebang and exec bit
# if things get more extensive, should probably use git init templates
cat
<<
EOF
> .git/hooks/pre-push
#!/bin/sh
remote="
\$
1"
url="
\$
2"
if [ "
\$
url" != "
$ODOO
" ]
then
exit 0
fi
echo "Pushing to the odoo remote (
$ODOO
) is forbidden, push to the dev remote"
echo
echo "See git help push if you really want to push to odoo"
exit 1
EOF
chmod
+x .git/hooks/pre-push
# add basic repos as remotes
git remote add odoo
$ODOO
git remote add dev
$DEV
if
[
$include_merge
]
then
git remote add merge
$ODOO
git config remote.merge.fetch
'+refs/pull/*/merge:refs/remotes/merge/*'
fi
echo
git remote update
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment