3 ms·
Implementations of layout in source code tend to suffer hard-to-diff from a source control point of view. Everytime you move an existing component into a wrapp
by teyc 7y ago
Implementations of layout in source code tend to suffer hard-to-diff from a source control point of view.
Everytime you move an existing component into a wrapper, the identation breaks how the diff shows up.
Perhaps we need a XML formatter that instead of pretty formats, sets the indentation to 0, when we commit code changes. However, that makes the source hard to read.
So instead of a diff that reads line
- <panel>
- <textblock>foo</textblock>
- </panel>
+ <vpanel>
+ <panel>
+ <textblock>foo</textblock>
+ </panel>
+ </vpanel>
We get
+ <vpanel>
<panel>
<textblock>foo</textblock>
</panel>
+ </vpanel>
Another problem is with the end tags, it is difficult as in the previous example to tell which opening tag an end tag is
for.
A pretty formatter could solve this problem too.
<vpanel id="vertical-wrapper">
<panel id="heading">
<textblock>foo</textblock>
</panel><!-- heading -->
</vpanel><!-- vertical-wrapper -->
Perhaps the level of indentation could be added visually
too
<vpanel id="vertical-wrapper"> <!-- vertical-wrapper -->
<panel id="heading"> <!-- heading -->
<textblock>foo</textblock> <!-- textblock -->
</panel> <!-- -->
</vpanel> <!-- -->
but then we bring back the problem of the ugly diffs, gah!
- andrewflnr 7y agoYou can pass -b to git diff to get exactly your first result. I would lean toward editor tooling for the latter case, myself.