On 2013-09-10 12:09 PM, ishikawa wrote: > On (2013年09月10日 00:08), Scott Johnson wrote: >> >> Thus Spoke ishikawa: >>> >>> I wonder if trying to re-indent legacy code according to the current style >>> is a good idea or not. (It is a little irritating to modify a part of legacy >>> code and find my editor trying to follow the current style while the rest of >>> the file is in different style.) >> I'd recommend we not do this, as it will likely break hg blame. I've >> worked for companies in the past that checked in formatting changes >> alongside other, functional changes, and it ended (even in small >> codebases) in a lot of chaos - mostly that it was a) difficult to review >> those changes and b) difficult to track back which >> bugs/tickets/developers changed which sets of code. >> >> If we were going to do this, though, we should have a separate bug for >> formatting changes, and check in those changes in separate patches >> (maybe even one per file whose formatting is to be changed). >> >> ~Scott > > So you are suggesting something like > step 1 - request for formatting a file indented in an arcane format, i.e., > reformat it according to the currently adopted code. > step 2 - then after the re-formating of the file is done, > particular bug or something is fixed in the newly formatted code. > > I understand the merit of leaving the code as is since hg blame won't work > nicely with such file-wide format change as in step-1. > (Or maybe we can teach hg blame to ignore such change, etc. but maybe too > much work: the idea would be to mark formatting change with a particular > string [maybe tag name] and let hg blame to ignore such tag to look for a > previous patch that touched each line. Hmm. Maybe too much work indeed)
There is hg blame -w (and git blame -w) which ignores whitespace changes, but that's slower, and also hgweb (and I think gitweb) don't support it. Cheers, Ehsan _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform