Commit 0d3abf10 authored by Vincent Lefevre's avatar Vincent Lefevre
Browse files

Move code for git info to its own shell script "".

* New file: sh script to output MPFR version information
  for a Git working tree (old code from tests/
* tests/ replace some output_info code by the use of this
* add to EXTRA_DIST as a consequence
  (a comment explains why).
* README: list this new file as a consequence.
parent f9a4ae08
......@@ -34,10 +34,15 @@ nobase_dist_doc_DATA = AUTHORS BUGS COPYING COPYING.LESSER NEWS TODO \
examples/rndo-add.c examples/sample.c examples/threads.c \
# Note: Even though tarballs do not normally contain a .git directory,
# we need to distribute to avoid a failure in case a
# tarball is tested from a Git directory (this script is executed by
# tests/ in case of a Git working tree), which happens with
# "make distcheck", for instance.
EXTRA_DIST = PATCHES VERSION doc/ doc/check-typography doc/mini-gmp \
tools/check_mparam.c tools/ck-clz_tab tools/ck-copyright-notice \
tools/ck-mparam tools/ck-news tools/ck-version-info tools/ \
cd tools/bench && $(MAKE) $(AM_MAKEFLAGS) bench
......@@ -53,6 +53,7 @@ test-driver - auxiliary installation file
tests/ - directory containing the testsuite (for "make check")
tools/ - directory containing various tools
tune/ - directory containing files for tuning MPFR - script to get Git-related MPFR version information
According to the special exception to the GNU General Public License,
the autotools files compile, config.sub, config.guess,,
......@@ -39,14 +39,8 @@ output_info = { \
fi; \
fi; \
if [ "x`git rev-parse --is-inside-work-tree 2> /dev/null`" = xtrue ]; then \
git tag --contains | sed -n 's/-root$$//p' > excluded-branches; \
gitb=`git branch --format='%(refname:short)' --contains | \
$(GREP) -v '^(' | $(GREP) -v -F -f excluded-branches -x`; \
rm excluded-branches; \
gitc=`git rev-list --count HEAD`; \
gith=`git rev-parse --short HEAD`; \
gitm=`git diff-index --name-only HEAD`; \
echo "[git] $$gitb-$$gitc-$$gith$${gitm:+ (modified)}"; \
gitv=`GREP=$(GREP) $(top_srcdir)/`; \
echo "[git] $$gitv"; \
fi; \
$(GREP) -v '^\(PASS\|FAIL\) ' tversion.log 2> /dev/null || true; \
# This script outputs additional MPFR version information for a
# Git working tree (Git branch, total commit count, commit id,
# and whether the current HEAD is modified). It is called in
# tests/ for "make check", but may be used by other
# tools that need such information.
# Note that this does not replace version information found in
# the VERSION file, which may still need to be output in addition
# to the output of this script.
set -e
if [ "x`git rev-parse --is-inside-work-tree 2> /dev/null`" != xtrue ]; then
echo "$0: This script should be executed from a Git working tree." >&2
exit 1
# Normally passed by with "GREP=$(GREP)".
git tag --contains | sed -n 's/-root$//p' > excluded-branches
gitb=`git branch --format='%(refname:short)' --contains | \
$GREP -v '^(' | $GREP -v -F -f excluded-branches -x`
rm excluded-branches
gitc=`git rev-list --count HEAD`
gith=`git rev-parse --short HEAD`
gitm=`git diff-index --name-only HEAD`
echo "$gitb-$gitc-$gith${gitm:+ (modified)}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment