quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] trailing whitespace


From: Andrew Morton
Subject: [Quilt-dev] trailing whitespace
Date: Thu, 28 Apr 2005 16:26:03 -0700

I think it would be good if quilt were to warn users when their patches add
trailing whitespace.  It's a silly thing to do.

In patch-scripts I run this during `refpatch'

check_patch()
{
        if grep "^+.*[  ]$" $P/patches/$(stripit $1).patch
        then
                echo warning: $1 adds trailing whitespace
        fi
}

and I have a separate command, strip-trailing-whitespace.sh which is

#!/bin/sh
#
# Strip any trailing whitespace which a unified diff adds.
#

strip1()
{
        TMP=$(mktemp /tmp/XXXXXX)
        cp $1 $TMP
        sed -e '/^+/s/[         ]*$//' < $TMP > $1
        rm $TMP
}

for i in $*
do
        strip1 $i
done





reply via email to

[Prev in Thread] Current Thread [Next in Thread]