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

Re: Q: How to ignore minor changes in text files?

From: Andrey Repin <anrdaemon_at_freemail.ru>
Date: Thu, 24 Dec 2009 04:27:16 +0300

Greetings, Julian Mitchell!

>> > > The project that I am working on utilises a code generation tool.
>> > The header of every source file includes a comment with a date\time
>> > stamp of when it was generated. The problem is that every time the
>> > code is generated the svn change check algorithm marks all files as
>> > having been changed even though only a handful have actually had
>> > actual code changes.
>> > >
>> > > Is there a way to tailor the change check algorithm with, say, a
>> > regex, to ignore certain contents of a text file e.g. comment
>> > lines?
>> >
>> > To my knowledge, there is not. You could consider writing a client-
>> > side script that committers should run before checking in source,
>> > to normalize such comment lines e.g. to remove the date/time. You
>> > could also write a companion server-side hook script to reject any
>> > commit where the only difference is such a comment line.
>>
>> I think the current wisdom is, don't source control files that can be
>> generated. So, for the same reason you [usually] don't store binaries that
>> you build from your source don't store code files that are generated. Make
>> the generation part of the build so that any dev running the build script
>> gets the files generated for them.

> Thanks for both your input.
> Ryan - is there a convenient place to hook in to the client side? I would
> like to catch this prior it to being displayed as a modification.
> Bob - you are correct and I agree with you however the generation process
> takes a while (30s - 1minute) and the controlled package files are ghastly
> to diff from a code readability perspective.

1 min is nothing compared to pain you're trying to create, IMO.
First, there's no way to "hook on client side" - it is essentially the same
that regenerating the files.
Second, as pointed out, you do not put RESULTS of your work into SOURCE
control system. At the very least, it creates data duplication in repository,
as I'm pretty sure the code you building files from is in the same repository.
(And trust me, even pretty simple projects could have building times longer
than one minute)

P.S.
Please, don't top-post.

--
WBR,
 Andrey Repin (anrdaemon_at_freemail.ru) 24.12.2009, <4:22>
Sorry for my terrible english...
Received on 2009-12-24 02:30:41 CET

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.