2009-12-07 20:19:56 +01:00
|
|
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/cvs.sgml,v 1.52 2009/12/07 19:19:56 mha Exp $ -->
|
1998-12-18 17:08:19 +01:00
|
|
|
|
2001-10-09 20:46:00 +02:00
|
|
|
<appendix id="cvs">
|
2003-11-24 20:08:02 +01:00
|
|
|
<appendixinfo>
|
1999-05-22 04:27:25 +02:00
|
|
|
<authorgroup>
|
|
|
|
<author>
|
|
|
|
<firstname>Marc</firstname>
|
|
|
|
<surname>Fournier</surname>
|
|
|
|
</author>
|
|
|
|
<author>
|
|
|
|
<firstname>Tom</firstname>
|
|
|
|
<surname>Lane</surname>
|
|
|
|
</author>
|
|
|
|
<author>
|
|
|
|
<firstname>Thomas</firstname>
|
|
|
|
<surname>Lockhart</surname>
|
|
|
|
</author>
|
2007-05-30 19:41:43 +02:00
|
|
|
<author>
|
|
|
|
<firstname>David</firstname>
|
|
|
|
<surname>Fetter</surname>
|
|
|
|
</author>
|
1999-05-22 04:27:25 +02:00
|
|
|
</authorgroup>
|
|
|
|
<date>1999-05-20</date>
|
2003-11-24 20:08:02 +01:00
|
|
|
</appendixinfo>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
2009-12-07 20:19:56 +01:00
|
|
|
<title>The Source Code Repository</title>
|
1998-12-18 17:08:19 +01:00
|
|
|
|
1999-04-06 17:38:10 +02:00
|
|
|
<para>
|
2001-11-21 06:53:41 +01:00
|
|
|
The <productname>PostgreSQL</productname> source code is stored and managed using the
|
2009-12-07 20:19:56 +01:00
|
|
|
<productname>CVS</productname> version control system. An official mirror using
|
|
|
|
<productname>Git</productname> is also available, for those who wish to use a
|
|
|
|
distributed version control system. This mirror is automatically
|
|
|
|
updated whenever the main repository changes, so it always contains the latest
|
|
|
|
versions of all branches.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Using <productname>git</> is the most flexible way to work with the source, and it
|
|
|
|
allows you to work offline without having constant access to the project servers.
|
|
|
|
<productname>rsync</> based <productname>cvs</> also lets you work offline, but
|
|
|
|
lacks many of the other advantages of <productname>git</>.
|
1999-04-06 17:38:10 +02:00
|
|
|
</para>
|
1998-12-18 17:08:19 +01:00
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
<para>
|
2008-04-21 13:06:13 +02:00
|
|
|
Our Wiki, <ulink
|
2009-12-07 20:19:56 +01:00
|
|
|
url="http://wiki.postgresql.org/wiki/Working_with_CVS"></ulink> and
|
|
|
|
<ulink url="http://wiki.postgresql.org/wiki/Working_with_Git"></ulink>,
|
|
|
|
has additional details on working with CVS and Git.
|
1999-05-22 04:27:25 +02:00
|
|
|
</para>
|
1998-12-18 17:08:19 +01:00
|
|
|
|
2009-12-07 20:19:56 +01:00
|
|
|
<sect1 id="git">
|
|
|
|
<title>Getting The Source Via <productname>Git</></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
With <productname>git</> you will make a copy of the entire code repository
|
|
|
|
to your local machine, so you will have access to all history and branches
|
|
|
|
offline. This is the fastest and most flexible way to develop or test
|
|
|
|
patches.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<procedure>
|
|
|
|
<title>Git</title>
|
|
|
|
|
|
|
|
<step>
|
|
|
|
<para>
|
|
|
|
You will need an installed version of <productname>git</>, which you can get
|
|
|
|
from <ulink url="http://git-scm.com"></ulink>. Many systems also have a recent
|
|
|
|
version of <application>git</> installed by default, or available in their
|
|
|
|
package repository system.
|
|
|
|
</para>
|
|
|
|
</step>
|
|
|
|
|
|
|
|
<step>
|
|
|
|
<para>
|
|
|
|
To being using the git repository, make a clone of the official mirror:
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
git clone git://git.postgresql.org/git/postgresql.git
|
|
|
|
</programlisting>
|
|
|
|
|
|
|
|
This will copy the full repository to your local machine, so it may take
|
|
|
|
a while to complete, especially if you have a slow internet connection.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The git mirror can also be reached via the http protocol in case for example
|
|
|
|
a firewall is blocking access to the git protocol. Just replace the URL
|
|
|
|
like:
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
git clone http://git.postgresql.org/git/postgresql.git
|
|
|
|
</programlisting>
|
|
|
|
|
|
|
|
The http protocol is less efficient than the git protocol, so it will be
|
|
|
|
slightly slower to use.
|
|
|
|
</para>
|
|
|
|
</step>
|
|
|
|
|
|
|
|
<step>
|
|
|
|
<para>
|
|
|
|
Whenever you want to get the latest updates in the system, <command>cd</>
|
|
|
|
into the repository, and run:
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
git fetch
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</step>
|
|
|
|
</procedure>
|
|
|
|
<para>
|
|
|
|
<productname>git</> can do a lot more things than just fetch the source. For
|
|
|
|
more information, consult the man pages for the product, or the website at
|
|
|
|
<ulink url="http://git-scm.com"></>.
|
|
|
|
</para>
|
|
|
|
</sect1>
|
|
|
|
|
2000-09-29 22:21:34 +02:00
|
|
|
<sect1 id="anoncvs">
|
1999-05-22 04:27:25 +02:00
|
|
|
<title>Getting The Source Via Anonymous <productname>CVS</productname></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If you would like to keep up with the current sources on a regular
|
2002-10-20 22:58:02 +02:00
|
|
|
basis, you can fetch them from our <productname>CVS</productname> server
|
1999-05-22 04:27:25 +02:00
|
|
|
and then use <productname>CVS</productname> to
|
|
|
|
retrieve updates from time to time.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<procedure>
|
|
|
|
<title>Anonymous CVS</title>
|
|
|
|
|
|
|
|
<step>
|
|
|
|
<para>
|
2002-10-20 22:58:02 +02:00
|
|
|
You will need a local copy of <productname>CVS</productname>
|
1999-05-22 04:27:25 +02:00
|
|
|
(Concurrent Version Control System), which you can get from
|
2006-11-17 06:29:46 +01:00
|
|
|
<ulink url="http://www.nongnu.org/cvs/"></ulink> (the official
|
|
|
|
site with the latest version) or any GNU software archive site
|
|
|
|
(often somewhat outdated). Many systems have a recent version of
|
1999-05-22 04:27:25 +02:00
|
|
|
<application>cvs</application> installed by default.
|
|
|
|
</para>
|
|
|
|
</step>
|
|
|
|
|
|
|
|
<step>
|
|
|
|
<para>
|
|
|
|
Do an initial login to the <productname>CVS</productname> server:
|
|
|
|
|
2005-11-05 00:14:02 +01:00
|
|
|
<programlisting>
|
2003-06-11 17:28:55 +02:00
|
|
|
cvs -d :pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot login
|
2005-11-05 00:14:02 +01:00
|
|
|
</programlisting>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
2003-06-11 17:28:55 +02:00
|
|
|
You will be prompted for a password; you can enter anything except
|
|
|
|
an empty string.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
1999-05-22 04:27:25 +02:00
|
|
|
You should only need to do this once, since the password will be
|
2006-11-17 06:29:46 +01:00
|
|
|
saved in <filename>.cvspass</filename> in your home directory.
|
1999-05-22 04:27:25 +02:00
|
|
|
</para>
|
|
|
|
</step>
|
|
|
|
|
|
|
|
<step>
|
|
|
|
<para>
|
2001-11-21 06:53:41 +01:00
|
|
|
Fetch the <productname>PostgreSQL</productname> sources:
|
2005-11-05 00:14:02 +01:00
|
|
|
<programlisting>
|
2001-09-23 03:16:35 +02:00
|
|
|
cvs -z3 -d :pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot co -P pgsql
|
2005-11-05 00:14:02 +01:00
|
|
|
</programlisting>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
2003-06-11 17:28:55 +02:00
|
|
|
This installs the <productname>PostgreSQL</productname> sources into a
|
1999-05-22 04:27:25 +02:00
|
|
|
subdirectory <filename>pgsql</filename>
|
|
|
|
of the directory you are currently in.
|
|
|
|
</para>
|
1998-12-18 17:08:19 +01:00
|
|
|
|
1999-05-22 04:27:25 +02:00
|
|
|
<para>
|
|
|
|
This initial checkout is a little slower than simply downloading
|
2009-12-07 20:19:56 +01:00
|
|
|
a <filename>tar.gz</filename> file. The advantage of <productname>CVS</>
|
1999-05-22 04:27:25 +02:00
|
|
|
doesn't show up until you want to update the file set later on.
|
|
|
|
</para>
|
|
|
|
</step>
|
|
|
|
|
|
|
|
<step>
|
|
|
|
<para>
|
|
|
|
Whenever you want to update to the latest <productname>CVS</productname> sources,
|
|
|
|
<command>cd</command> into
|
2007-02-01 01:28:19 +01:00
|
|
|
the <filename>pgsql</filename> subdirectory, and issue:
|
2005-11-05 00:14:02 +01:00
|
|
|
<programlisting>
|
|
|
|
cvs -z3 update -d -P
|
|
|
|
</programlisting>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
|
|
|
This will fetch only the changes since the last time you updated.
|
|
|
|
You can update in just a couple of minutes, typically, even over
|
|
|
|
a modem-speed line.
|
|
|
|
</para>
|
|
|
|
</step>
|
|
|
|
|
|
|
|
<step>
|
|
|
|
<para>
|
|
|
|
You can save yourself some typing by making a file <filename>.cvsrc</filename>
|
2007-02-01 01:28:19 +01:00
|
|
|
in your home directory that contains:
|
1998-12-18 17:08:19 +01:00
|
|
|
|
2005-11-05 00:14:02 +01:00
|
|
|
<programlisting>
|
1998-12-18 17:08:19 +01:00
|
|
|
cvs -z3
|
|
|
|
update -d -P
|
2005-11-05 00:14:02 +01:00
|
|
|
</programlisting>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
2006-10-23 20:10:32 +02:00
|
|
|
This supplies the <option>-z3</option> option to all <command>cvs</> commands, and the
|
|
|
|
<option>-d</option> and <option>-P</option> options to <command>cvs update</>. Then you just have
|
2007-02-01 01:28:19 +01:00
|
|
|
to say:
|
2005-11-05 00:14:02 +01:00
|
|
|
<programlisting>
|
|
|
|
cvs update
|
|
|
|
</programlisting>
|
1999-05-22 04:27:25 +02:00
|
|
|
|
|
|
|
to update your files.
|
|
|
|
</para>
|
|
|
|
</step>
|
|
|
|
</procedure>
|
|
|
|
|
|
|
|
<para>
|
2006-11-17 06:29:46 +01:00
|
|
|
<productname>CVS</productname> can do a lot of other things, such
|
|
|
|
as fetching prior revisions of the
|
|
|
|
<productname>PostgreSQL</productname> sources rather than the
|
|
|
|
latest development version. For more info consult the manual that
|
|
|
|
comes with <productname>CVS</productname>, or see the online
|
|
|
|
documentation at <ulink url="http://www.nongnu.org/cvs/"></ulink>.
|
1999-05-22 04:27:25 +02:00
|
|
|
</para>
|
2007-05-30 19:41:43 +02:00
|
|
|
<para>
|
2007-05-30 20:00:08 +02:00
|
|
|
<productname>CVS</productname> has deficiencies. For example,
|
|
|
|
generating diffs that add or remove files requires write access to the
|
2007-07-11 01:03:18 +02:00
|
|
|
CVS repository. To work around that deficiency, use
|
2007-05-30 20:00:08 +02:00
|
|
|
<productname>cvsutils</productname>, which is packaged in several
|
|
|
|
operating systems, and is available in source form at <ulink
|
2009-12-07 20:19:56 +01:00
|
|
|
url="http://www.red-bean.com/cvsutils/"></ulink>, or use <productname>git</>
|
|
|
|
or another system designed to work offline.
|
2007-05-30 19:41:43 +02:00
|
|
|
</para>
|
2007-07-11 01:03:18 +02:00
|
|
|
|
|
|
|
<para>
|
|
|
|
Note that building <productname>PostgreSQL</productname> from a CVS
|
|
|
|
pull requires reasonably up-to-date versions of <application>bison</>
|
|
|
|
and <application>flex</>, which are not needed to build from a distribution
|
|
|
|
tarball because the files made with them are pre-built in a tarball.
|
2009-06-23 05:46:00 +02:00
|
|
|
You will need Perl as well.
|
2007-07-11 01:03:18 +02:00
|
|
|
Otherwise the tool requirements are the same as building from source.
|
|
|
|
</para>
|
1999-05-22 04:27:25 +02:00
|
|
|
</sect1>
|
1998-12-18 17:08:19 +01:00
|
|
|
|
2007-03-27 03:45:22 +02:00
|
|
|
<sect1 id="rsync">
|
|
|
|
<title>Getting The Source Via <productname>rsync</productname></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
An alternative to using anonymous CVS for retrieving the
|
|
|
|
<productname>PostgreSQL</productname> source tree is
|
|
|
|
<productname>rsync</productname>, an incremental file transfer tool.
|
2009-12-07 20:19:56 +01:00
|
|
|
A major advantage to using <productname>rsync</productname> instead of
|
|
|
|
plain <productname>cvs</> is that it
|
2007-03-27 03:45:22 +02:00
|
|
|
can reliably replicate the <emphasis>entire</emphasis> CVS repository
|
|
|
|
on your local system, allowing fast local access to <command>cvs</>
|
|
|
|
operations such as <option>log</option> and <option>diff</option>.
|
|
|
|
Other advantages include fast synchronization to the
|
|
|
|
<productname>PostgreSQL</productname> server due to an efficient
|
|
|
|
streaming transfer protocol which only sends the changes since the last
|
|
|
|
update.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
You can download the CVS repository using this command:
|
|
|
|
<programlisting>
|
2008-04-03 11:52:03 +02:00
|
|
|
rsync -avzH --delete anoncvs.postgresql.org::pgsql-cvs cvsroot/
|
2007-03-27 03:45:22 +02:00
|
|
|
</programlisting>
|
|
|
|
For full instructions, see the "rsync" section in the
|
|
|
|
<ulink url="http://pgfoundry.org/docman/view.php/1000040/4/PGBuildFarm-HOWTO.txt">
|
|
|
|
pgbuildfarm instructions</ulink>.
|
|
|
|
</para>
|
|
|
|
</sect1>
|
1999-05-22 04:27:25 +02:00
|
|
|
</appendix>
|