2

A junior programmer in our office has an unfortunate (but understandable) habit of using Eclipse's "Correct all the indentation in this file" feature. As a result, his checked out copy includes thousands of lines that register as changes, simply because the whitespace is different. Accepting all these changes - while other people are also working on the same code, some of them in different offices - will lead to conflicts. At the same time we don't want to throw away all the work he's done.

Are there any options for Darcs to ignore or normalise whitespace changes; or tools that can revert the differences?

Marcus Downing
  • 10,054
  • 10
  • 63
  • 85
  • 4
    How about getting everyone to use the feature? – Marcelo Cantos Jul 02 '10 at 10:54
  • 1
    I think you should learn from the junior.... – astorcas Jul 02 '10 at 11:08
  • Don't get me wrong, I would happily agree to keeping the sources well organised and properly formatted. Sadly the reality of collaboration is that one coder's improved formatting can conflict with another coder's work. – Marcus Downing Jul 02 '10 at 14:17
  • 3
    @astorcas consistent formatting is a good idea but it is very bad to have formatting changes in the same change set as feature changes/bug fixes for 2 reasons: conflicts as seen here and diffing revisions gives you output that no person could understand – Keith Jul 02 '10 at 17:34

1 Answers1

2

i have never used darcs, but this is how i'd deal with it:

(cd newbies-copy && darcs diff --diff-opts -w) | (cd fresh-copy && darcs apply)

hopefully i got the darcs commands right, just skimmed the manual.

just somebody
  • 18,602
  • 6
  • 51
  • 60