Should I try to create a pretty change history in DVCS?

I used to go back and edit my Mercurial to try and create a beautiful story. I could put two unrelated things in one transaction, or I could make several commits that were better understood as one commit, but in the end it seemed like a waste of time, and I overcame the slight difficulty that I had less perfect history.

Are you still doing this? Why is it worth you, why don't you do it more, have you ever done it or are you thinking about getting started?

If I contributed to the Linux kernel, it would obviously be worth my time, because otherwise Linus would refuse my patch, but IMO - one of the big mistakes of dvcs users is to imagine that their project is similar to the kernel Linux My projects usually have only a few developers.

+4
source share
5 answers

I try to clear the change history. My workflow follows the path of creating a small but meaningful editing, fixing, repeating until some series of large modifications are made. Then I go back and reorder / group together into functional atomic commits and push these revised commits. This allows other developers to see commits that create functional differences, rather than the massive walls of trivial commits. It is easier to debug regressions when they occur.

+5
source

It is not worth the effort.

As long as the “hint” is good, you better let the story be ugly and accurately reflect how the work came about, and not how you wanted the work to come about.

When I dig a story for half the time, I ask: "What did it look like?" but in the other half of the time I ask: “Why did it look like this”, and I want to see the developer’s unsuccessful attempts, even if he would rather remove the fact that he ever tried to go a path that wasn’t pan out.

+10
source

If this is an application that you can expect to go back and forth between revisions, such as branching from old revs to support different versions, I would think that clean and repetitive commit messages are a valuable tool for the project.

If you are just working on incremental updates, unable to break the assembly under rare conditions, I would not worry too much about them being very accurate.

+1
source

If you are just adding a story and watching the latest version, it does not matter to you.

I recently worked on a project where someone “merged” using a large patch in two branches. I found it, looking for changes that introduced the function to see which tests appeared along with it. Spent a lot of time.

You will also see that the new dimension, which merges with the introduction, makes the bisection work much more difficult. It is no longer just left or right.

0
source

I am trying to recall that commit comments will appear in an annotated view later. Therefore, I am trying to explain the intention and the overall effect of the changes made, but not the change itself.

0
source

All Articles