[darcs-users] Whitespace adjustment patch type?

Ashley Moran ashley.moran at patchspace.co.uk
Mon Apr 13 16:10:12 UTC 2009


Hi

Just wondering, how feasible would a patch type that adjusts only the  
spaces (and/or tabs) in a line be?

The reason I ask is because I often get a lot of code I try to keep  
lined up, eg one I just typed (although this is a pretty tame example):

   property :id,         Serial
   property :name,       String, :nullable => false, :length => (2..40)
   property :identifier, String, :nullable => false, :length => (2..40)

Now I just came to add another on the end, giving this:

   property :id,         Serial
   property :name,       String, :nullable => false, :length => (2..40)
   property :identifier, String, :nullable => false, :length => (2..40)
   property :summary,    Boolean, :nullable => false, :default => false

What I want to do now is line them up like this:

   property :id,         Serial
   property :name,       String,  :nullable => false, :length => (2..40)
   property :identifier, String,  :nullable => false, :length => (2..40)
   property :summary,    Boolean, :nullable => false, :default => false

But that would make my "Add summary flag" patch touch two other,  
unrelated properties.  That would conflict with, say:

   property :identifier, String, :nullable => false, :length => (2..80)

So I was wondering, would it be possible for darcs to have a patch  
type that could change whitespace only, allowing the merge of, say,  
patches trying to change:
   "blah    blah        blah"

to:
   "blah blah  blah"

and:
   "blah    BLAH        blah"

the result being:

   "blah BLAH  blah"


Interested to know what everyone else thinks of this (and the  
whitespace problem in general).

Thanks
Ashley

-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
http://aviewfromafar.net/
http://twitter.com/ashleymoran








More information about the darcs-users mailing list