Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it worth the effort to create pretty revision history in a DVCS?

I used to go back and edit my Mercurial commits to try to create a pretty history. I might have put two unrelated things into one commit, or I might have made several commits that were better understood as a single commit, but eventually it seemed like a waste of time and I got over the minor embarrassment of having less than perfect history.

Do you still do this? Why is it worthwhile to you, why don't you do it anymore, did you ever do this, or are you thinking of starting?

If I was contributing to the Linux kernel this would obviously be worth my time because Linus would reject my patch otherwise, but IMO one of the big mistakes of dvcs users is to imagine their project is like the Linux kernel. My projects usually only have a few developers.

like image 297
joeforker Avatar asked Dec 04 '22 16:12

joeforker


2 Answers

It is not worth the effort.

So long as 'tip' is pretty, you're better off letting history be ugly and accurately reflect how the work came about, rather than how you wished the work came about.

When I'm digging through history half the time I'm asking "what did this used to look like?" but the other half of the time I'm asking "why did this end up looking like this" and I want to see the developer's abortive attempts even if he'd rather erase the fact that he ever tried to go down a path that didn't pan out.

like image 171
Ry4an Brase Avatar answered Dec 11 '22 15:12

Ry4an Brase


I make an effort to clean up my revision history. My workflow goes along the lines of make a small but meaningful edit, commit, repeat until some series of larger modifications are made. Then I go back and re-order/group commits together into functionally atomic commits, and push those revised commits out. This allows other developers to see commits which create functional differences, as opposed to massive walls of trivial commits. Makes it easier to debug regressions when they occur.

like image 39
jasedit Avatar answered Dec 11 '22 17:12

jasedit