diff --git a/build/jam/FileRules b/build/jam/FileRules index 6d137800aa..bb8f011454 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -315,14 +315,19 @@ rule CopySetHaikuRevision target : source actions CopySetHaikuRevision1 { $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) - revision=`LC_ALL=C LANG=C svn info $(HAIKU_TOP) 2> /dev/null | - grep Revision | awk '{printf $2}'` + # Try svn or git-svn + # Extract from "Revision: 12345" line + revision=`(LC_ALL=C LANG=C svn info $(HAIKU_TOP) || + (cd $(HAIKU_TOP) && LC_ALL=C LANG=C git svn info)) 2> /dev/null | + grep Revision | awk '{printf $2}'` if [ "$revision" = 0 -o "$revision" = "" ]; then - revision=`(cd $(HAIKU_TOP) && LC_ALL=C LANG=C git svn info) - 2> /dev/null || - (git log --max-count=1 --grep="git-svn-id:" 2> /dev/null | - grep git-svn-id: | cut -d '@' -f 2 | - awk '{printf $1}') 2> /dev/null` + # git-svn not present or not configured for this repository + # Try searching git logs for last git-svn commit + # Extract from " git-svn-id: .../haiku/trunk@12345 ..." line + revision=`cd $(HAIKU_TOP) && + git log --max-count=1 --grep="git-svn-id:" 2> /dev/null | + grep "git-svn-id:" | cut -d '@' -f 2 | + awk '{printf $1}'` fi if [ "$revision" = "" ]; then revision=0