Skip to content

Commit

Permalink
Be explicit about the PostgreSQL git repo branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Smith authored and Greg Smith committed Jan 14, 2012
1 parent 512e4a6 commit c9375d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions HISTORY
Expand Up @@ -3,3 +3,4 @@
2011-01-15 Add "clean" command and improve documentation
2011-05-08 Switch to git as default repo, more doc updates
2011-06-20 Add "rebuild" command
2012-01-14 Be explicit about the PostgreSQL git repo branch
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -450,7 +450,7 @@ If you have any hints, changes or improvements, please contact:
Credits
=======

Copyright (c) 2009-2011, Gregory Smith
Copyright (c) 2009-2012, Gregory Smith
All rights reserved.
See COPYRIGHT file for full license details

Expand Down
15 changes: 11 additions & 4 deletions peg
Expand Up @@ -87,6 +87,11 @@ TGZDIR="tgz"
GITPGROOTDIR="postgresql"
CVSPGROOTDIR="pgsql"

# Remote branch of interest for the PostgreSQL git repo
# TODO An easy UI for checking out back branches would be nice
GITMASTERREPO="origin"
GITMASTERBRANCH="$GITMASTERREPO/master"

function error {
# Report an error and save its value for exit and wrap's command filtering
ERROR=$1
Expand Down Expand Up @@ -163,7 +168,8 @@ function pull_git {
# Apparently we already have a repo around
echo "Updating existing git repository at $GITPGROOTDIR"
cd $GITPGROOTDIR
git fetch
git fetch $GITMASTERREPO
git merge $GITMASTERBRANCH
else
echo "Creating new git repository from master repo"
git clone git://git.postgresql.org/git/postgresql.git
Expand Down Expand Up @@ -261,7 +267,7 @@ function checkout_repo_git {
link_project_git
cd $PGSRC/$PGPROJECT
# TODO This will fail if this branch already exists.
git checkout -b $PGPROJECT
git checkout -b $PGPROJECT $GITMASTERBRANCH
}

function checkout_repo_cvs {
Expand Down Expand Up @@ -349,10 +355,11 @@ function update_cvs {
}

function update_git {
# TODO Should this split fetch/merge steps based on whether
# TODO Should this consider not merging automatically based on whether
# a PGPROJECT name was passed or not?
cd $PGSRC/$PGPROJECT
git pull
git fetch $GITMASTERREPO
git merge $GITMASTERBRANCH
}

function update_project {
Expand Down

0 comments on commit c9375d7

Please sign in to comment.