summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2012-03-23 09:42:27 -0700
committerMichal Marek <mmarek@suse.cz>2012-03-26 22:54:00 +0200
commit7f3bd6c9cb8e9fa2b57bfa860cd3e734a28f48ed (patch)
tree2fdc4e64fce2f6697683b4b05c20877036d62572 /scripts
parent9aaf440f8fabcebf9ea79a62ccf4c212e6544b49 (diff)
downloadlwn-7f3bd6c9cb8e9fa2b57bfa860cd3e734a28f48ed.tar.gz
lwn-7f3bd6c9cb8e9fa2b57bfa860cd3e734a28f48ed.zip
setlocalversion: Use "grep -q" instead of piping output to "read dummy"
In some circumstances (eg when running a build in an emacs shell buffer), I get a spew of messages like grep: writing output: Broken pipe from setlocalversion, because the "read" subshell apparently exits as soon as it reads one line and gives EPIPE to grep. It's not clear to me why this way of writing the check was used instead of just using grep -q to suppress output, but unless there is some deep reason I don't know, this way looks cleaner to me anyway, and gets rid of the ugly message spew. (I double checked at http://pubs.opengroup.org/onlinepubs/009604499/utilities/grep.html and "grep -q" is specified in POSIX / SuS, so hopefully even people cross-compiling the kernel on some bizarre host OS can't complain about this change) Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/setlocalversion3
1 files changed, 1 insertions, 2 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 4d403844e137..bd6dca8a0ab2 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -75,8 +75,7 @@ scm_version()
[ -w . ] && git update-index --refresh --unmerged > /dev/null
# Check for uncommitted changes
- if git diff-index --name-only HEAD | grep -v "^scripts/package" \
- | read dummy; then
+ if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
printf '%s' -dirty
fi