From: xufeng <xufwang@163.com>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
nico-linuxsetlocalversion@schottelius.org, wsa@the-dreams.de
Subject: [PATCH] setlocalversion: fix error detectition of kernel git repository
Date: Sat, 21 Jan 2017 07:23:57 +0800 [thread overview]
Message-ID: <1484954637.5246.4.camel@163.com> (raw)
This patch fixed the error using 'git rev-parse --show-cdup' to check
that git is used as SCM to track the current directory. The return
value of this command is not null string when the .git directory is
not in kernel topdir.
Signed-off-by: Xufeng Wang <xufwang@163.com>
---
scripts/setlocalversion | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 966dd39..7966e39 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -43,7 +43,7 @@ scm_version()
fi
# Check for git and a git repo.
- if test -z "$(git rev-parse --show-cdup 2>/dev/null)" &&
+ if test -z "$(git rev-parse --show-cdup &>/dev/null)" &&
head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
--
2.9.3
next reply other threads:[~2017-01-20 23:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 23:23 xufeng [this message]
2017-01-21 20:54 ` [PATCH] setlocalversion: fix error detectition of kernel git repository Nico Schottelius
2017-01-22 2:10 ` xufeng
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=1484954637.5246.4.camel@163.com \
--to=xufwang@163.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nico-linuxsetlocalversion@schottelius.org \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox