From: Richard Knutsson <ricknu-0@student.ltu.se>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [SCRIPT] Remove "space damage" from patches
Date: Sun, 28 Jan 2007 22:37:01 +0100 [thread overview]
Message-ID: <45BD177D.6060907@student.ltu.se> (raw)
Hello Andrew and all
I recently tried "git-apply" on the 2.6.20-rc6-mm1 patch and found it to complain about white-spaces.
So as a mean to (hopefully) cut down on these nasty white-spaces (and sometimes tabs) I wrote this
little script. All it does is checking (lines that are going to be added) for spaces before tabs
and trailing spaces/tabs. I tried it on 2.6.20-rc6-mm1 and it seem to work well
If there is someone interested, _please_ take it. Any suggestion are welcomed :)
Richard Knutsson
---
#!/bin/sh
#./<script-name> <patch to check>
msg="Checking..."
echo $msg
while [ "$msg" ]; do \
msg=""
if grep -q -E "^\+ * + " $1; then \
msg="Found whitespace before tab"
echo $msg
sed --in-place -r "s/^\+( *) {8}( *) /\+\1 \2 /" $1
sed --in-place -r "s/^\+( *) {1,7} /\+\1 /" $1
fi
if grep -q -E "^\+.*[ ]$" $1; then \
msg="Found trailing whitespace/tab"
echo $msg
sed --in-place -r "s/^\+(.*)([^ ])[ ]+$/\+\1\2/" $1
sed --in-place -r "s/^\+[ ]+$/\+/" $1
fi
if [ "$msg" != "" ]; then \
echo "Cleaning done, will make another run"
fi
done
next reply other threads:[~2007-01-28 21:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-28 21:37 Richard Knutsson [this message]
2007-01-28 22:52 ` [SCRIPT] Remove "space damage" from patches Oleg Verych
2007-01-29 0:08 ` Richard Knutsson
2007-01-29 0:31 ` Oleg Verych
2007-01-29 1:26 ` Richard Knutsson
2007-01-29 1:43 ` Oleg Verych
2007-01-29 2:00 ` Richard Knutsson
2007-01-29 2:27 ` Oleg Verych
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45BD177D.6060907@student.ltu.se \
--to=ricknu-0@student.ltu.se \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.