Question about features
Maarten Bosmans
mkbosmans at gmail.com
Tue Nov 3 10:34:04 GMT 2009
2009/11/3 Daniel Carrera <dcarrera at gmail.com>:
> On Tue, Nov 3, 2009 at 9:07 AM, Maarten Bosmans <mkbosmans at gmail.com> wrote:
>> This really sound like you would be better of doing the fix for B on a
>> separate bugfix branch. Is there any specific reason you have for
>> mixing revisions for feature A and B, or am I just misunderstanding
>> your workflow?
>
> For small changes I can't be bothered. And small changes is usually
> what we are talking about. The boss might ask for a small change, or I
> might notice an easy to fix bug while I'm working on a larger feature.
> These things (esp the latter) happen very often.
What I do is to have separate branch for each new feature I'm working
on and one bugfix branch to commit all those one-line bugfixes to.
This way it all stays separated and the history of your main branch
reflects the development process accurately.
Another nice way of working is something I believe is called 'daggy
fixes', or something like that. When you want to fix a bug, you branch
from the point the bug was introduced into the mainline and merge that
bugfix branch back into the mainline. You can then very easily see
which revisions where affected by the bug and, if you branched between
the introduction of the bug and the merge of the bugfix, which
branches don't contain the bugfix.
> Furthermore, adding a feature in reality usually involves adding three
> different things which should logically be in different commits.
> Usually I'll write one or more functions that talks to the database, a
> view that interacts with the user, and a controller that lies between
> them. For these things it doesn't make sense to say "I'll work on
> these in different branches". You need to develop them together, but I
> still want to have them in different commits.
I didn't mean to suggest that you split your commits for one feature
into different branches, just that avoiding the bugfix commits
intertwined in the feature commits would lead to a clearer branch
history.
> Daniel.
Maarten
More information about the bazaar
mailing list