2013-11-28

There are a few more messages in the “Missed Schedule” backlog, and I really hope that WordPress is going to address this really annoying bug soon as I have to recheck my blog multiple times a day now.

Back on topic:

Development tools should become more version control friendly, and version control tools more whitespace tolerant

I’m taking Delphi and Bitbucket here as an example, but this holds for many more development tools and version control tools.

Ultimately, you want changes to be as simple as this one: only the relevant changed lines show up as an actual change.

But often changes include convoluted non-relevant information.

A few things development tools should not do:

Switch between white space conventions between versions.

For instance this change. It is between Delphi versions, and about the only change in the .groupproj is between tab and spaces as whitespace characters in the XML export.

In Bitbucket, you can use “side by side” difference to get a feel for the non-important whitespace changes.

Switch around attributes (for XML the order is not important, but most comparisons don’t get that).

For instance this change. It is between Delphi versions, and changes the order of Targets and Projects attributes within the MSBuild element.

(The change also shows a bit of whitespace; I cut away the irrelevant lines that had only whitespace changes using Beyond Compare)

A few things version control systems should do:

They should use different colorization when ony white space has changed.

See again this change for which most of the lines the only change is from tabs to spaces.

They should allow to ignore end-of-line changes like this. When you view the side-by-side difference, there is no change at all.

The above ones are just simple things: there are far more, but fixing the above would make life much easier.

One of the comparison tools I like most is Beyond Compare. It assist me in getting these white space things sorted out before they end up in version control, for instance by these features:

Showing white space characters (which is a lot like showing formatting marks like paragraph delimiters  in Word).

Indicate when whitespace is important, and where not.

Map file extensions to file types beyond the mapping that Windows itself does.

Has a rule based systems for ignoring non-relevant content in files that is very flexible.

An extension system that allows for instance to tidy the XML before comparison.

But ultimately, the development tools and version control systems should make this easier for us so we can focus more on things that are important.

Afterthoughts

GitHub has a ?w=0 parameter for this.

Just to show how ignorant BitBucket is on this, the (very old) feature requests I just found:

20120324: site / master / issues / #3812 – Add option to ignore line endings and/or whitespace in a diff (BB-3879) — Bitbucket.

20121022: site / master / issues / #5008 – Hide whitespace in diff (BB-6261) — Bitbucket.

20130118: site / master / issues / #6024 – Ability to ignore whitespace changes in the side-by-side diff viewer (BB-7282) — Bitbucket.

–jeroen

Filed under: .NET, C#, Delphi, Development, DVCS - Distributed Version Control, Software Development, Source Code Management, Visual Studio and tools

Show more