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

Jim Meyering jim at meyering.net
Fri Mar 6 21:47:58 UTC 2009


Otavio Salvador wrote:
> Jim Meyering <jim at meyering.net> writes:
>
>> 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.
>
> When you say "filter it" you mean pass it thorugh git filter-branch or
> any other way?

I meant "filter" as pipe-stdout-into that perl command.

Filter-branch might work.

Here's what I know works:

First, rebase your changes to the change set just before
TBR (trailing-blank-removal).
Record them, e.g.,

  git format-patch ... > patch

and then run this to remove all trailing blanks in the patch:

  perl -pi -e 's/[ \t]+$//' patch

And then start a new branch off of the TBR change set,
and apply the sanitized change set with:

  git am patch

Then you can rebase and continue as usual.



More information about the parted-devel mailing list