[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to cope with patches sanely



(Note: I've just discovered (read: started using) pristine-tar. I'm no
expert at all.)

On 31/01/2008, Daniel Leidert wrote:
> > You're wrong, I don't store the whole orig.tar.gz, I keep its
> > content, and the delta (often less than 2kb).
> 
> Then I seem to misunderstand you. What does "content" mean, if you do
> not store the whole .orig.tar.gz? Do you just store the diffs between
> upstream versions?

The idea isn't to store “foo_bar.orig.tar.gz” in $VCS, rather to store
its content, that is: all files created by e.g. the following:
  tar xfz foo_bar.orig.tar.gz --strip 1

Keeping track of gzipped tarballs wouldn't make sense.

The point is: you're losing some details when doing so (timestamp stuff,
permissions or whatever), that's why the deltas generated by
pristine-tar are needed to then generate back bit-identical gzipped
tarballs.

> Can you show me a public example? To be honest, I have some problems
> to understand your workflow.

A package maintained by Pierre (pdnsd). I'll try not to forget any
command (and not pasting the whole output of every command, that's not
relevant here):
| # Clone the repo.
| $ git-clone git://git.madism.org/pdnsd.git pdnsd.git
| …
| $ cd pdnsd.git
| 
| # Create a local branch out of a remote one, and switch to it.
| $ git-checkout -b pristine-tar origin/pristine-tar
| …
| 
| # Examine the delta (4kB).
| $ ls -l
| -rw-r--r-- 1 kibi kibi 4921 2008-01-31 16:44 pdnsd_1.2.6-par.orig.tar.gz.delta
| 
| # Switch back to the debian branch (a local one has been created out
| # of origin/debian since the latter is the default one on the remote).
| $ git-checkout debian
| …
| 
| # Here is the magic.
| $ ./debian/rules check-tarball
| Regenerating pdnsd_1.2.6-par.orig.tar.gz.

The check-tarball target is a quick hack by Pierre to automate the use
of the delta file (in the pristine-tar branch) to generate back the
original tarball from what is contained in git. No need to uscan or
apt-get source, and you don't rely on anything but your repository.

You can also keep things separated: debian/ only stored in unstable,
experimental, and so on branches. An independent pristine-tar one (as
above). And an independent upstream one, where you only import the
original tarball (and eventually tagging them with their version so that
the above check-tarball hack can be extended).

To give you an idea of the extra cost of storing original tarballs
(their content, rather) in git: graphviz's unpacked sources are around
30MB. Gzipped, around 5MB. After having imported 7 such tarballs in git
(and still with my whole debian/-only packaging), I'm now reaching 10MB.
For everything.

Hope it clarifies a bit.

Cheers,

-- 
Cyril Brulebois

Attachment: pgpZap7SPAKtU.pgp
Description: PGP signature


Reply to: