4 ms·
> But after suffering one too many bad merges where indentation is left mangled, we need braces. Or semantics-aware merging.
by naasking 8y ago
> But after suffering one too many bad merges where indentation is left mangled, we need braces.
Or semantics-aware merging.
- AnimalMuppet 8y agoI'm not an expert on Python by any means, but if I understand correctly, the end of the indent level is the only way you know that the block ended. That seems to me to make it impossible to write semantics-aware merging (presuming I understood what you meant by the term).
- dooglius 8y agoWhy does this make it impossible? The merger just needs to understand where blocks begin and end, not sure I follow you
- AnimalMuppet 8y agoWhat I thought you meant is that you need something that will straighten out the mangled whitespace. I didn't think that was possible, because the only thing that marks where blocks begin and end is whitespace. If the whitespace gets mangled, there's no other syntax you can use to straighten it out. But I'm beginning to think you meant that you want a merge tool that doesn't mangle the whitespace in the first place. If the pre-merge whitespace is unmangled, and the merge tool understand Python whitespace, then at a minimum it should be able to flag ambiguous changes and ask for help.
- dooglius 8y agoRight, a merge tool that understands Python semantics at some level should be able to detect when a block's indentation has changed, and adjust the indentation of any changes to that block correspondingly.
- deleted 8y ago[deleted]