[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: exclude parts of a file from version control?

From: John Peacock <john.peacock_at_havurah-software.org>
Date: Tue, 05 Aug 2008 09:37:40 -0400

Jan Hendrik wrote:
> can parts of a file be marked to be excluded from versioning? Like
> a comment in code the parser ignores?

Short answer: no, a file is versioned or not. The Subversion client has
no clue what is inside the file itself; it is all bytes (and whether the
file is binary or textural is based on a somewhat fragile heuristic).

> I have a Perl script that takes an input file (actually a listing of
> items a Word macro has preformatted for HTML), extracts several
> things for title, description, keyword tags, adds an illustration and
> some other things, and creates a separate file for each item.
> Naturally it works best if the items in the listing have a good deal of
> similarity, and likewise in every case of use there have to be some
> adjustments made to the Perl code to meet specific requirements.
> However, there is no reason to have these adjustments ending up
> in the repository. Some of these actually enhance the script for
> future abuse though and should be versioned yet, as I would like
> the script as such.

Slightly longer answer: generated files should normally not be versioned
(i.e. added to the repository). The one common exception to this is
storing compiled code as part of a tag, so you can always regenerate a
tag/release at any point in the future (though you can eliminate this
exception through the use of pegged externals in your tag for shared code).

I think that with a slight bit of refactoring, you should be able to
partition the versioned part of the script with the generated portion.
It is common with Perl to generate a base class and multiple derived
classes which override portions of the base class behavior. Each of
these classes could be versioned, but the base class would change slower
than the derived classes.



To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-08-05 15:38:24 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.