]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
scripts: Make git commit info always present
authorTao Hu <taoh@nvidia.com>
Wed, 8 Aug 2012 09:30:06 +0000 (17:30 +0800)
committerIshan Mittal <imittal@nvidia.com>
Fri, 1 Apr 2016 05:06:17 +0000 (10:36 +0530)
LOCALVERSION_AUTO is set by default.
And git commit will be part of the version.
E.g. "3.1.10-g0fe9b4a" where 0fe9b4a is the commit.

The version will appear in kpanic logs.
It would help developers to know the exact kernel version.

But a tagged commit (main-ics-2012.06.07-A5) will lead to no git info.
E.g. "3.1.10"
This patch will solve the issue.

Change-Id: I28370ada903b4be12bfc51eb3626512572e15c20
wChange-Id: I9dbb6c0a9e2964ead92114197a6d5c457ed7aab9
Signed-off-by: Tao Hu <taoh@nvidia.com>
Reviewed-on: http://git-master/r/123670
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Prajakta Gudadhe <pgudadhe@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Rebase-Id: R4634652e8627a86f7d4034e7657e45d10eb1f33f

scripts/setlocalversion

index 63d91e22ed7ccd18a0cd77852af647112ed216bb..3d6be47e846bf103d07b9ad1c8f2faa425b2d6d4 100755 (executable)
@@ -46,26 +46,9 @@ scm_version()
        if test -z "$(git rev-parse --show-cdup 2>/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
-               # it, because this version is defined in the top level Makefile.
-               if [ -z "`git describe --exact-match 2>/dev/null`" ]; then
-
-                       # If only the short version is requested, don't bother
-                       # running further git commands
-                       if $short; then
-                               echo "+"
-                               return
-                       fi
-                       # If we are past a tagged commit (like
-                       # "v2.6.30-rc5-302-g72357d5"), we pretty print it.
-                       if atag="`git describe 2>/dev/null`"; then
-                               echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
-
-                       # If we don't have a tag at all we print -g{commitish}.
-                       else
-                               printf '%s%s' -g $head
-                       fi
-               fi
+               # Regardless whether it is a tagged commit (like "v2.6.30-rc6"),
+               # we will put the commit info in.
+               printf '%s%s' -g $head
 
                # Is this git on svn?
                if git config --get svn-remote.svn.url >/dev/null; then