You are viewing bramcohen

Mon, Apr. 18th, 2011, 08:42 am
MrJoy: Re: You are missing the point.

Whenever I conduct a merge, I DO use three-way merge tools, but I have learned to ALWAYS ALWAYS ALWAYS sanity-check the conclusions it reaches, hunk-by-hunk.

Except of course in the rare case I want to close out a branch outright and denote that in the history, and then I do a "git merge -s ours" to denote it as such.

You may also find "git rerere" relevant when dealing with repetitious merges that might otherwise get history confused.

However, ultimately, when I find such situations arise I usually conclude it is time to start reminding people that Git is about "patches as communication", and encourage them to act accordingly. I invariably see a decrease in ill-conceived and ill-executed merges that may or may not be doing what people *expect*, a reduction in spurious commits that only communicate minutiae of an individual's particular workflow (and not meaningful information about what the individual set out to *achieve*), and so forth.

Problems like the on you describe are a symptom of people abdicating their responsibility as engineers to The Machine. Now, I am perfectly happy to let machines do for me what they can do better than I, (garbage collection + references > pointers, for example) but when an engineer accepts changes into the codebase he or she is working on without even being AWARE of what those changes are -- a situation that happens by definition when one leaves merging to an automated tool -- then the engineer is inviting a world of hurt upon him or herself.

Know what's in your codebase, or expect it to be broken often and unexpectedly. Communicate upstream in the form of cogent, terse patches that express the whole of a change, and nothing but that change.

To do otherwise necessarily requires one of two options: A) Coordinate early and often to minimize the risk of deviation (I.E. don't branch), or B) Fall into irreconcilable chaos. SVN users are familiar with both. Git users are familiar with A only by virtue of bad habits learned in SVN-land, and familiar with B only by virtue of the worst form of laziness. (I.E. not the kind Larry Wall spoke of...)

No HTML allowed in subject


Notice! This user has turned on the option that logs IP addresses of anonymous posters. 

(will be screened)