diff options
author | Matthew Ahrens <[email protected]> | 2018-10-22 12:23:30 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-10-22 12:23:30 -0700 |
commit | da4f331b4136a50e41ce3bb639ad48e519611210 (patch) | |
tree | 5ac72d36858f6142d64f916cd88538d1ae300150 | |
parent | ae3d8491427343904c66d69ba94731553727eb26 (diff) |
Make gitrev more reliable
In some build methods, the gitrev is unnecessarily set to "unknown".
We can improve this by changing the gitrev to use
`git describe --always --long --dirty`.
This gets the revision even when no tag matches (--always). It prints
the hash even when it exactly matches a tag (--long). And if there are
uncommitted changes, it appends "-dirty", rather than failing (--dirty).
Reviewed-by: George Melikov <[email protected]>
Reviewed by: Pavel Zakharov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Matthew Thode <[email protected]>
Signed-off-by: Matthew Ahrens <[email protected]>
Closes #8034
-rwxr-xr-x | scripts/make_gitrev.sh | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/scripts/make_gitrev.sh b/scripts/make_gitrev.sh index 757f00fbc..bab9be88d 100755 --- a/scripts/make_gitrev.sh +++ b/scripts/make_gitrev.sh @@ -37,7 +37,5 @@ trap cleanup EXIT # Check if git is installed and we are in a git repo. git rev-parse --git-dir > /dev/null 2>&1 -# Check if there are uncommitted changes -git diff-index --quiet HEAD # Get the git current git revision -ZFS_GIT_REV=$(git describe 2>/dev/null) +ZFS_GIT_REV=$(git describe --always --long --dirty 2>/dev/null) |