setlocalversion (ffaf62a8050b5f7995083ee93526b57d8d79fec4) | setlocalversion (630ff0faf84eac6448c851961d4865471a792160) |
---|---|
1#!/bin/sh 2# SPDX-License-Identifier: GPL-2.0 3# 4# This scripts adds local version information from the version 5# control systems git, mercurial (hg) and subversion (svn). 6# 7# If something goes wrong, send a mail the kernel build mailinglist 8# (see MAINTAINERS) and CC Nico Schottelius --- 45 unchanged lines hidden (view full) --- 54 # If only the short version is requested, don't bother 55 # running further git commands 56 if $short; then 57 echo "+" 58 return 59 fi 60 # If we are past a tagged commit (like 61 # "v2.6.30-rc5-302-g72357d5"), we pretty print it. | 1#!/bin/sh 2# SPDX-License-Identifier: GPL-2.0 3# 4# This scripts adds local version information from the version 5# control systems git, mercurial (hg) and subversion (svn). 6# 7# If something goes wrong, send a mail the kernel build mailinglist 8# (see MAINTAINERS) and CC Nico Schottelius --- 45 unchanged lines hidden (view full) --- 54 # If only the short version is requested, don't bother 55 # running further git commands 56 if $short; then 57 echo "+" 58 return 59 fi 60 # If we are past a tagged commit (like 61 # "v2.6.30-rc5-302-g72357d5"), we pretty print it. |
62 # 63 # Ensure the abbreviated sha1 has exactly 12 64 # hex characters, to make the output 65 # independent of git version, local 66 # core.abbrev settings and/or total number of 67 # objects in the current repository - passing 68 # --abbrev=12 ensures a minimum of 12, and the 69 # awk substr() then picks the 'g' and first 12 70 # hex chars. 71 if atag="$(git describe --abbrev=12 2>/dev/null)"; then 72 echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),substr($(NF),0,13))}' 73 74 # If we don't have a tag at all we print -g{commitish}, 75 # again using exactly 12 hex chars. 76 else 77 head="$(echo $head | cut -c1-12)" 78 printf '%s%s' -g $head | 62 if atag="$(git describe 2>/dev/null)"; then 63 echo "$atag" | awk -F- '{printf("-%05d", $(NF-1))}' |
79 fi | 64 fi |
65 66 # Add -g and exactly 12 hex chars. 67 printf '%s%s' -g "$(echo $head | cut -c1-12)" |
|
80 fi 81 82 # Check for uncommitted changes. 83 # This script must avoid any write attempt to the source tree, 84 # which might be read-only. 85 # You cannot use 'git describe --dirty' because it tries to 86 # create .git/index.lock . 87 # First, with git-status, but --no-optional-locks is only --- 70 unchanged lines hidden --- | 68 fi 69 70 # Check for uncommitted changes. 71 # This script must avoid any write attempt to the source tree, 72 # which might be read-only. 73 # You cannot use 'git describe --dirty' because it tries to 74 # create .git/index.lock . 75 # First, with git-status, but --no-optional-locks is only --- 70 unchanged lines hidden --- |