Message ID | 146740856798.33306.12339801003788127221.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Jul 01, 2016 at 02:29:28PM -0700, Dan Williams wrote: > The git-version script auto-appends the commit id, but complains if the > repository is missing. The complaint is benign, but we should also tag > builds outside of git with a '+' because who knows what changes were > made locally. > > Link: https://github.com/pmem/ndctl/issues/5 > Reported-by: Yi Zhang <yi.a.zhang@hotmail.com> > Signed-off-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
diff --git a/git-version b/git-version index 3823ee29afaf..9eb8fd654e38 100755 --- a/git-version +++ b/git-version @@ -38,9 +38,13 @@ elif test -d ${GIT_DIR:-.git} -o -f .git && VN=$(echo "$VN" | sed -e 's/-/./g'); else read COMMIT COMMIT_SUBJECT <<EOF - $(git log --oneline --abbrev=8 -n1 HEAD) + $(git log --oneline --abbrev=8 -n1 HEAD 2>/dev/null) EOF - VN="$(dirty ${DEF_VER}.git$COMMIT)" + if [ -z $COMMIT ]; then + VN="${DEF_VER}+" + else + VN="$(dirty ${DEF_VER}.git$COMMIT)" + fi fi echo $VN
The git-version script auto-appends the commit id, but complains if the repository is missing. The complaint is benign, but we should also tag builds outside of git with a '+' because who knows what changes were made locally. Link: https://github.com/pmem/ndctl/issues/5 Reported-by: Yi Zhang <yi.a.zhang@hotmail.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- git-version | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)