Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ if(NOT GIT_DESCRIBE_ERRCODE AND ${ROOT_PATCH_VERSION_ODD} EQUAL 1)
OUTPUT_VARIABLE GIT_DESCRIBE_ALWAYS
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(TIMESTAMP GIT_TIMESTAMP "%b %d %Y, %H:%M:%S" UTC)

if("${GIT_DESCRIBE_ALL}" MATCHES "^tags/v[0-9]+-[0-9]+-[0-9]+.*")
# GIT_DESCRIBE_ALWAYS: v6-16-00-rc1
Expand Down
3 changes: 2 additions & 1 deletion README/ReleaseNotes/v630/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,5 @@ This logic has been improved and is now as follows:
_(i)_ If the current head is a well-known branch, e.g. `master` or `v6-28-00-patches`, use the matching branch upstream;
_(ii)_ otherwise, try a branch that matches the name of the current head in the forked repository, if it exists; else try using the closest upstream head/tag below `HEAD`'s parent commit;
_(iii)_ as a last resort, if there is no preferred candidate, checkout the remote's default head.

- `etc/gitinfo.txt` and `build/version_number` have been removed. The data is accessible through `include/RGitCommit.h` and `include/ROOT/RVersion.hxx`, respectively.
- `ROOT_RELEASE_TIME` is now defined to `"00:00:00"`.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def is_manylinux():
ROOT_IO_KEEP = ['CMakeLists.txt', 'io', 'rootpcm']
ROOT_MATH_KEEP = ['CMakeLists.txt', 'mathcore']
ROOT_ETC_KEEP = ['Makefile.arch', 'class.rules', 'cmake', 'dictpch',
'gdb-backtrace.sh', 'gitinfo.txt', 'helgrind-root.supp',
'gdb-backtrace.sh', 'helgrind-root.supp',
'hostcert.conf', 'plugins', 'system.plugins-ios',
'valgrind-root-python.supp', 'valgrind-root.supp']
ROOT_PLUGINS_KEEP = ['TVirtualStreamerInfo']
Expand Down
15 changes: 3 additions & 12 deletions build/unix/makedistsrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ ROOTSRCDIR=$3

TARFILE=root_v$FILEVERS.source.tar

( cd $ROOTSRCDIR; git archive -v -o ../$TARFILE --prefix=root-$FILEVERS/ $GITTAG )

mkdir -p etc/root-$FILEVERS/etc
cp etc/gitinfo.txt etc/root-$FILEVERS/etc/
cd etc
tar -r -vf ../../$TARFILE root-$FILEVERS/etc/gitinfo.txt
cd ..
rm -rf etc/root-$FILEVERS
cd ..
gzip $TARFILE

exit 0
cd $ROOTSRCDIR \
&& git archive -v -o ../$TARFILE --prefix=root-$FILEVERS/ $GITTAG \
&& gzip $TARFILE
23 changes: 11 additions & 12 deletions build/win/makeresource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,25 @@ else
fi

# Use gitinfo.txt: more precise than the info in Rversion.h
GITBRANCH=`cat etc/gitinfo.txt|head -n1`
GITREV=`cat etc/gitinfo.txt|head -n2|tail -n1`
GITDATE="`cat etc/gitinfo.txt|tail -n1`"
GITYEARCOMMA=`echo $GITDATE|cut -d' ' -f3`
GITBRANCH=`cat include/RGitCommit.h|head -n1`
GITREV=`cat include/RGitCommit.h|head -n2|tail -n1`

# Can't do that inside the .rc file: FILEVERSION doesn't evaluate a>>b
VERSION=`grep "ROOT_RELEASE " include/RVersion.h | sed 's,^.*"\([^"]*\)".*$,\1,' | sed 's,[^[:digit:]], ,g'`
VERSION=`grep "ROOT_RELEASE " include/ROOT/RVersion.hxx | sed 's,^.*"\([^"]*\)".*$,\1,' | sed 's,[^[:digit:]], ,g'`
VER1=`echo $VERSION| cut -d ' ' -f 1| sed 's,^0,,'`
VER2=`echo $VERSION| cut -d ' ' -f 2| sed 's,^0,,'`
VER3=`echo $VERSION| cut -d ' ' -f 3| sed 's,^0,,'`

# 0: tag, 1: trunk, 2: branch
VERBRANCHFLAG=1
if [ "x${GITBRANCH/tag/}" != "x${GITBRANCH}" ]; then
# 0: tag, 1: master, 2: branch
VERBRANCHFLAG=2
if [ "x${GITBRANCH/tags/}" != "x${GITBRANCH}" ]; then
VERBRANCHFLAG=0
elif [ "x${GITBRANCH/branch/}" != "x${GITBRANCH}" ]; then
VERBRANCHFLAG=2
elif [ "x${GITBRANCH/heads/master}" != "x${GITBRANCH}" ]; then
VERBRANCHFLAG=1
fi

DATE="`date +'%F %T'`"
YEAR=`date +%Y`
HOST=`hostname`

cat > $RC <<EOF
Expand All @@ -66,7 +65,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
${RCFILEICON}
#endif

#define ROOT_VERSION_STR ROOT_RELEASE " (${GITREV}@${GITBRANCH}, ${GITDATE})\0"
#define ROOT_VERSION_STR ROOT_RELEASE " (${GITREV}@${GITBRANCH}, ${DATE})\0"

#if (${VERBRANCHFLAG} != 0)
# define ROOT_IS_PRERELEASE VS_FF_PRERELEASE
Expand Down Expand Up @@ -105,7 +104,7 @@ BEGIN
VALUE "FileDescription", "ROOT ${RCFILETITLE} ${FILESTEM}\0"
VALUE "FileVersion", ROOT_VERSION_STR
VALUE "InternalName", "${FILESTEM}\0"
VALUE "LegalCopyright", "Copyright (C) 1995-${GITYEARCOMMA} Rene Brun and Fons Rademakers.\0"
VALUE "LegalCopyright", "Copyright (C) 1995-${YEAR}, Rene Brun and Fons Rademakers.\0"
VALUE "OriginalFilename","${FILENAME}\0"
VALUE "ProductName", "ROOT\0"
VALUE "ProductVersion", ROOT_VERSION_STR
Expand Down
26 changes: 2 additions & 24 deletions config/root-config.bat.in
Original file line number Diff line number Diff line change
Expand Up @@ -109,32 +109,10 @@ for %%w in (%*) do (
set out=!out! !prefix!
)
if "!arg!"=="--version" (
rem Output the version number. If RVersion.h can not be found, give up.
if exist !incdir!\RVersion.h (
for /f "tokens=2,3" %%a in (!incdir!\RVersion.h) do (
if "%%a"=="ROOT_RELEASE" (
set ROOT_RELEASE=%%~b
)
)
set out=!out! !ROOT_RELEASE!
) else (
echo "cannot read ${incdir}/RVersion.h"
exit /b 1
)
set out=!out! @ROOT_VERSION@
)
if "!arg!"=="--git-revision" (
rem Output the git revision number. If RGitCommit.h can not be found, give up.
if exist !incdir!\RGitCommit.h (
for /f "tokens=2,3" %%a in (!incdir!\RGitCommit.h) do (
if "%%a"=="ROOT_GIT_COMMIT" (
set ROOT_GIT_COMMIT=%%~b
)
)
set out=!out! !ROOT_GIT_COMMIT!
) else (
echo "cannot read !incdir!\RGitCommit.h"
exit /b 1
)
set out=!out! @ROOT_GIT_COMMIT@
)
if "!arg!"=="--python-version" (
set out=!out! @pythonvers@
Expand Down
8 changes: 1 addition & 7 deletions config/root-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -556,13 +556,7 @@ while test $# -gt 0; do
out="$out @ROOT_VERSION@"
;;
--git-revision)
### Output the git revision number. If RGitCommit.h can not be found, give up.
if test -r "${incdir}/RGitCommit.h"; then
out="$out `sed -n 's,.*ROOT_GIT_COMMIT *\"\(.*\)\".*,\1,p' < \"${incdir}/RGitCommit.h\"`"
else
echo "cannot read ${incdir}/RGitCommit.h"
exit 1
fi
out="$out @ROOT_GIT_COMMIT@"
;;
--python-version)
out="$out @pythonvers@"
Expand Down
31 changes: 25 additions & 6 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,36 @@
############################################################################
# CMakeLists.txt file for building ROOT (global) core package
############################################################################

file(WRITE ${CMAKE_BINARY_DIR}/etc/gitinfo.txt
"${GIT_DESCRIBE_ALL}\n${GIT_DESCRIBE_ALWAYS}\n${GIT_TIMESTAMP}\n")

file(WRITE ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp
if(GIT_DESCRIBE_ALL)
file(WRITE ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp
"#ifndef ROOT_RGITCOMMIT_H
#define ROOT_RGITCOMMIT_H
#define ROOT_GIT_BRANCH \"${GIT_DESCRIBE_ALL}\"
#define ROOT_GIT_COMMIT \"${GIT_DESCRIBE_ALWAYS}\"
#endif"
)
)
else()
math(EXPR ROOT_MINOR_VERSION_ODD ${ROOT_MINOR_VERSION}%2)
if(${ROOT_MINOR_VERSION_ODD} EQUAL 1)
# Dev release
file(WRITE ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp
"#ifndef ROOT_RGITCOMMIT_H
#define ROOT_RGITCOMMIT_H
#define ROOT_GIT_BRANCH \"heads/master\"
#define ROOT_GIT_COMMIT \"v${ROOT_MAJOR_VERSION}-${ROOT_MINOR_VERSION}-${ROOT_PATCH_VERSION}\"
#endif"
)
else()
# Production release / patch release
file(WRITE ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp
"#ifndef ROOT_RGITCOMMIT_H
#define ROOT_RGITCOMMIT_H
#define ROOT_GIT_BRANCH \"heads/v${ROOT_MAJOR_VERSION}-${ROOT_MINOR_VERSION}-patches\"
#define ROOT_GIT_COMMIT \"v${ROOT_MAJOR_VERSION}-${ROOT_MINOR_VERSION}-${ROOT_PATCH_VERSION}\"
#endif"
)
endif()
endif()

set_source_files_properties(${CMAKE_BINARY_DIR}/ginclude/RConfigure.h
PROPERTIES GENERATED TRUE)
Expand Down
1 change: 0 additions & 1 deletion core/base/inc/TROOT.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ friend TROOT *ROOT::Internal::GetROOT2();
void InitSystem(); ///< Operating System interface
void InitThreads(); ///< Initialize threads library
void InitInterpreter(); ///< Initialize interpreter (cling)
void ReadGitInfo(); ///< Read Git commit SHA1 and branch name
void *operator new(size_t l) { return TObject::operator new(l); }
void *operator new(size_t l, void *ptr) { return TObject::operator new(l,ptr); }

Expand Down
36 changes: 2 additions & 34 deletions core/base/src/TROOT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,8 @@ TROOT::TROOT(const char *name, const char *title, VoidFuncPtr_t *initfunc)
fBuiltDate = IDATQQ(__DATE__);
fBuiltTime = ITIMQQ(__TIME__);

ReadGitInfo();
fGitCommit = ROOT_GIT_COMMIT;
fGitBranch = ROOT_GIT_BRANCH;

fClasses = new THashTable(800,3); fClasses->UseRWLock();
//fIdMap = new IdMap_t;
Expand Down Expand Up @@ -2384,39 +2385,6 @@ Longptr_t TROOT::ProcessLineFast(const char *line, Int_t *error)
return result;
}

////////////////////////////////////////////////////////////////////////////////
/// Read Git commit information and branch name from the
/// etc/gitinfo.txt file.

void TROOT::ReadGitInfo()
{
#ifdef ROOT_GIT_COMMIT
fGitCommit = ROOT_GIT_COMMIT;
#endif
#ifdef ROOT_GIT_BRANCH
fGitBranch = ROOT_GIT_BRANCH;
#endif

TString gitinfo = "gitinfo.txt";
char *filename = gSystem->ConcatFileName(TROOT::GetEtcDir(), gitinfo);

FILE *fp = fopen(filename, "r");
if (fp) {
TString s;
// read branch name
s.Gets(fp);
fGitBranch = s;
// read commit SHA1
s.Gets(fp);
fGitCommit = s;
// read date/time make was run
s.Gets(fp);
fGitDate = s;
fclose(fp);
}
delete [] filename;
}

Bool_t &GetReadingObject() {
TTHREAD_TLS(Bool_t) fgReadingObject = false;
return fgReadingObject;
Expand Down