Simplify haiku-revision for git, now that we provide revision-tags in our central git repo:
* instead of describing the changeset from perspective of the current branch's root, we describe it relative to the last reachable hrev-tag git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41979 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -13,53 +13,14 @@ determineGitRevision()
|
|||||||
# only determine the haiku-revision if anything has changed from
|
# only determine the haiku-revision if anything has changed from
|
||||||
# last build
|
# last build
|
||||||
if [ -z "$revision" -o "$lastBuiltRevision" != "$localRev" ]; then
|
if [ -z "$revision" -o "$lastBuiltRevision" != "$localRev" ]; then
|
||||||
haikuBranch=`git describe --abbrev=0 --match 'haiku/*.base' \
|
# the revision we use is the description of HEAD with respect to the
|
||||||
| $SED -re 's/haiku\/(.*)\.base/\1/'`
|
# last reachable hrev-(haiku-revision-)tag
|
||||||
if [ -z "$haikuBranch" ]; then
|
revision=`git describe --dirty --tags --match=hrev*`
|
||||||
echo "*** unable to find haiku branch the build is based on"
|
if echo "$revision" | grep -- '-' >/dev/null; then
|
||||||
exit 1;
|
# HEAD is not directly a changeset from Haiku's central repo, so we
|
||||||
fi
|
# add the current branch name as additional info
|
||||||
haikuTip=`git rev-list -n1 haiku/${haikuBranch}.tip`
|
branchName=`git branch | grep '*' | cut -b 3-`
|
||||||
if [ -z "$haikuTip" ]; then
|
revision="$revision [$branchName]"
|
||||||
echo "*** unable to find tip of haiku branch the build is based on"
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make sure that haiku-tip matches the remote tracking branch,
|
|
||||||
# otherwise the tag hasn't been fetched/updated and we should
|
|
||||||
# print a warning
|
|
||||||
trackingBranch=`git branch -r --contains $haikuTip \
|
|
||||||
| grep -v -- '->' | tr -d ' '`
|
|
||||||
if [ -z "$trackingBranch" ]; then
|
|
||||||
echo "*** unable to find tracking branch the build is based on"
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
haikuTipLag=`git rev-list --count ${haikuTip}..$trackingBranch`
|
|
||||||
if [ "$haikuTipLag" != "0" ]; then
|
|
||||||
echo "*********************************************************"
|
|
||||||
echo "!!! haiku/${haikuBranch}.tip is $haikuTipLag behind \
|
|
||||||
remote tracking branch"
|
|
||||||
echo "!!! you may want to 'git fetch --tags' to update the tag"
|
|
||||||
echo "*********************************************************"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# the haiku revision the HEAD is based on is the nearest common ancestor
|
|
||||||
# of these two (i.e. the merge base)
|
|
||||||
haikuBaseRev=`git merge-base $localRev $haikuTip`
|
|
||||||
if [ -z "$haikuTip" ]; then
|
|
||||||
echo "*** unable to find merge-base for haiku tip and build"
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# the revision we use is the description of HEAD with
|
|
||||||
# respect to the root of the current branch
|
|
||||||
revision=`git describe --dirty --long --match=haiku/$haikuBranch`
|
|
||||||
if [ "$localRev" != "$haikuBaseRev" ]; then
|
|
||||||
# HEAD is not a changeset from Haiku's central repo, so we add
|
|
||||||
# a description of the changeset in Haiku's repo HEAD is based on
|
|
||||||
haikuBaseRevDescr=`git describe --long --match=haiku/$haikuBranch \
|
|
||||||
$haikuBaseRev`
|
|
||||||
revision="$revision [$haikuBaseRevDescr]"
|
|
||||||
fi
|
fi
|
||||||
echo $localRev >${haikuBuildOutputDir}/last-built-revision
|
echo $localRev >${haikuBuildOutputDir}/last-built-revision
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user