Skip to content

Commit 8558f59

Browse files
committed
setlocalversion: Ignote SCMs above the linux source tree
Dan McGee <dpmcgee@gmail.com> writes: > Note that when in git, you get the appended "+" sign. If > LOCALVERSION_AUTO is set, you will get something like > "eee-gb01b08c-dirty" (whereas the copy of the tree in /tmp still > returns "eee"). It doesn't matter whether the working tree is dirty or > clean. > > Is there a way to disable this? I'm building from a clean tarball that > just happens to be unpacked inside a git repository. One would think > setting LOCALVERSION_AUTO to false would do it, but no such luck... Fix this by checking if the kernel source tree is the root of the git or hg repository. No fix for svn: If the kernel source is not tracked in the svn repository, it works as expected, otherwise determining the 'repository root' is not really a defined task. Reported-and-tested-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 7b8ea53 commit 8558f59

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/setlocalversion‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ scm_version()
4343
fi
4444

4545
# Check for git and a git repo.
46-
if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
46+
if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
4747

4848
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
4949
# it, because this version is defined in the top level Makefile.
@@ -85,7 +85,7 @@ scm_version()
8585
fi
8686

8787
# Check for mercurial and a mercurial repo.
88-
if hgid=`hg id 2>/dev/null`; then
88+
if test -d .hg && hgid=`hg id 2>/dev/null`; then
8989
tag=`printf '%s' "$hgid" | cut -s -d' ' -f2`
9090

9191
# Do we have an untagged version?

0 commit comments

Comments
 (0)