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

Re: How do I manage temporary source code hacks with subversion?

From: Nicolai Scheer <scope_at_planetavent.de>
Date: Mon, 28 Sep 2009 17:15:07 +0200

Hi!

Andy Levy schrieb:
> On Mon, Sep 28, 2009 at 09:43, Jonty <subversion_at_jonmail.co.uk> wrote:
>> Hi,
>>
>> I am developing an application with the source code stored in
>> subversion. Occasionally I need to hack some part of the source with
>> code that I know is bad, but I need the hack so I can get on with
>> developing the rest of the application.
>>
>> How can I use subversion to track all the hacks in the source? I want
>> to make sure that I go back and rework those bad pieces of code before I
>> release the application. Is there a tool in subversion that will mark a
>> piece of code as a hack, remember the mark, and then let me list off all
>> the hacks that are still in the source?
>>
>> An example might make the question clear. Let's say I am writing two
>> functions, A and B. Both A and B are complicated and each one will
>> take several days to write. To make things worse they are mutually
>> recursive: A calls B in some conditions and B calls A in some
>> conditions.
>>
>> I set of coding function A. I reach the point where I need to call B
>> but I don't want to break off and write the whole thing. I write a
>> small function called B that returns a fixed value. This is a hack,
>> but I need it so I can carry on coding A.
>>
>> I want to commit the source to subversion but I also need to mark
>> the code for function B as a hack. Later when I write the correct
>> code for B and commit it I want the mark removed. And to keep track
>> of where I am I need a tool that can list all the marks.
>
> I think most people use TODOs (or similar), either as comments in
> their code or as markers in their IDE (or both, most likely). Why
> would you *not* want to keep this information as close as possible to
> the actual code, instead of abstracting it out into a different
> "system"?

Using TODOs as Andy suggests is perfectly fine. Additionally I use a
pre-commit hook that checks for debug comments prior to allowing the commit.
It justs checks for a specific Eclipse Todo-Tag which I use whenever I
add temporary debug code that I don't want to be commited.

Of course, that does not protect you from forgetting to add those
comments but it adds, to some xtend, another layer of security.

greetings,

Nico

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2401268

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-09-28 17:16:28 CEST

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