Re: Recovery Test Framework

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Aidan Van Dyk <aidan(at)highrise(dot)ca>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Fetter <david(at)fetter(dot)org>, Greg Stark <stark(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Recovery Test Framework
Date: 2009-01-13 09:09:27
Message-ID: 496C5A47.3010008@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Aidan Van Dyk wrote:
> With git, you pull down the complete *history* of whatever branch, tag,
> or reference you want to pull down.

You can do a so-called shallow clone, pulling only X most recent
commits, with "git clone --depth=X". There's some limitations on what
you can do with a shallow clone, but it's good enough for most purposes:
you can create your own branches, merge and rebase them with upstream
and create diffs.

> The *default* "clone" options are
> setup to pull down the history of all available branches and tags, but
> that's not mandatory.

Right.

Here's how to create a shallow clone with just the five most recent
commits, with master-branch only:

~$ mkdir pgsql-shallow
~$ cd pgsql-shallow/
~/pgsql-shallow$ git-init
Initialized empty Git repository in /home/hlinnaka/pgsql-shallow/.git/
~/pgsql-shallow$ git-remote add origin -t master
git://git.postgresql.org/git/postgresql.git
~/pgsql-shallow$ git-fetch origin --depth=5
remote: Counting objects: 3646, done.
remote: Compressing objects: 100% (2247/2247), done.
remote: Total 3646 (delta 1567), reused 2334 (delta 1317)
Receiving objects: 100% (3646/3646), 15.77 MiB | 508 KiB/s, done.
Resolving deltas: 100% (1567/1567), done.
From git://git.postgresql.org/git/postgresql
* [new branch] master -> origin/master

Not as straightforward as a plain git-clone, but it's possible. The
resulting repository is ~16 MB, which isn't very much even across a
crappy Internet connection.

> And the benefit of having the whole history of the branch available, is
> that you can work on the branch *and history* locally, committing,
> inspecting, reviewing, without needing to go back over the net.

Yeah. Before switching to git, I kept an rsync'd copy of the CVS
repository on my laptop anyway for those reasons.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-01-13 09:17:24 Re: Recovery Test Framework
Previous Message Fujii Masao 2009-01-13 09:03:39 Re: Multiplexing SUGUSR1