Staging
v0.5.1
https://github.com/torvalds/linux
Raw File
Tip revision: 1def630a6a49dda5bc89dfbd86656293640456f0 authored by Linus Torvalds on 06 June 2006, 00:57:02 UTC
Linux 2.6.17-rc6
Tip revision: 1def630
setlocalversion
#!/bin/sh
# Print additional version information for non-release trees.

usage() {
	echo "Usage: $0 [srctree]" >&2
	exit 1
}

cd "${1:-.}" || usage

# Check for git and a git repo.
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
	# Do we have an untagged version?
	if  [ "`git name-rev --tags HEAD`" = "HEAD undefined" ]; then
		printf '%s%s' -g `echo "$head" | cut -c1-8`
	fi

	# Are there uncommitted changes?
	if git diff-files | read dummy; then
		printf '%s' -dirty
	fi
fi
back to top