monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Questions about Monotone


From: Daniel Carrera
Subject: Re: [Monotone-devel] Questions about Monotone
Date: Wed, 08 Oct 2008 12:39:40 +0200
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Markus Wanner wrote:
I consider this a standard feature of pretty much ever VCS, including
even CVS: you simply tell it which files to commit, no?

Sorry, I was mentally thinking of also specific changes inside a file. I'm used to darcs, and I'm not used to CVS. So some times I might make weird assumptions. I had even forgotten that CVS lets you select files until you mentioned it.

Anyways, o


Ah, so you are talking about changes within the same file.

Yes, thats right. Often the changes are in the same file. It's a smallish program. Most of the functionality is in two files: a core program and a library, and then I have a bunch of front-end type files (PHP templates). So making a change often involves changing something in the core file.

Well, yeah, that's an area where monotone isn't that brilliant, yet.

One way to do it would be to use a branch for Feature_A, commit your
experimental changes there and then switch back to the main / stable
branch for Issue_B. As long as the changes don't conflict, the merge
algorithm does everything for you. Remember that branches are cheap.

Do I need to make a separate directory to make a branch? I'll read the documentation on branches and I'll probably have a question then.


Another way is to split logically different modules into different
files, which is advisable anyway, IMO.

Yes. This program is severely lacking in modularity. It was quite horrid when I first got it. The whole program was one single 1200-line if statement! There was only *one* function, and the effect of that function was to force all variables to be global! It was a "validate" function. If you wanted to validate an email, you would run validate('email') and then the function would look for a global variable called $email and validate that.


I've spent the last few years cleaning up the program. Moving code out of the if-statement-from-hell and putting the code into functions (*functions*!).

So anyways, I agree that modularity is where I want the program to be in the future. But truthfully it will be a long time before it gets there. You can also see why I am working on two things at once. "Feature_A" usually is refactoring the code to make it modular, clean and correct.


Anyways, I'll go read about branching with Monotone.

Cheers,
Daniel.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]