[parted-devel] nuke trailing blanks *without* inducing conflicts

Jim Meyering jim at meyering.net
Thu Mar 5 20:14:47 UTC 2009


I wrote:
> FYI, the condition of Parted's sources has been a thorn
> in our side for too long, and I've just realized that at
> least part of that can be resolved easily: by removing all
> trailing blanks (let's call them TB, like the disease).
>
> Of course, when you say "global changes", everyone with a grain of
> version-control experience says "don't do that, it'll induce needless
> conflicts".  And they're right -- at first glance.  However, if you
> have an existing change, patch, branch etc. against the old TB-afflicted
> sources, you can easily adjust it to apply to the new, TB-cleaned
> sources.  Just filter it through this:
...

This is all done:

    remove all trailing blanks
      http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=099eaa4acd0d8

    build: enable "make syntax-check" rule to prohibit trailing spaces
      http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=5a47323884454

If anyone complains that their patches no longer apply,
remember this:

    However, if you
    have an existing change, patch, branch etc. against the old TB-afflicted
    sources, you can easily adjust it to apply to the new, TB-cleaned
    sources.  Just filter it through this:

        perl -pe 's/[ \t]+$//'

    then it will apply just as well to the post-cleanup code as the
    original applied to the pre-cleanup code.



More information about the parted-devel mailing list