Git fork

GIT-BUILD-OPTIONS: propagate project's source directory

A couple of our tests require knowledge around where to find the
project's source directory in order to locate files required for the
test itself. Until now we have been wiring these up ad-hoc via new,
specialized variables catered to the specific usecase. This is quite
awkward though, as every test that potentially needs to locate paths
relative to the source directory needs to grow another variable.

Introduce a new "GIT_SOURCE_DIR" variable into GIT-BUILD-OPTIONS to stop
this proliferation. Remove existing variables that can be derived from
it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
c5823641 03944513

+6 -10
+1 -2
GIT-BUILD-OPTIONS.in
··· 9 9 GIT_PERF_MAKE_OPTS=@GIT_PERF_MAKE_OPTS@ 10 10 GIT_PERF_REPEAT_COUNT=@GIT_PERF_REPEAT_COUNT@ 11 11 GIT_PERF_REPO=@GIT_PERF_REPO@ 12 + GIT_SOURCE_DIR=@GIT_SOURCE_DIR@ 12 13 GIT_TEST_CMP=@GIT_TEST_CMP@ 13 14 GIT_TEST_CMP_USE_COPIED_CONTEXT=@GIT_TEST_CMP_USE_COPIED_CONTEXT@ 14 15 GIT_TEST_GITPERLLIB=@GIT_TEST_GITPERLLIB@ 15 16 GIT_TEST_INDEX_VERSION=@GIT_TEST_INDEX_VERSION@ 16 - GIT_TEST_MERGE_TOOLS_DIR=@GIT_TEST_MERGE_TOOLS_DIR@ 17 17 GIT_TEST_OPTS=@GIT_TEST_OPTS@ 18 18 GIT_TEST_PERL_FATAL_WARNINGS=@GIT_TEST_PERL_FATAL_WARNINGS@ 19 - GIT_TEST_POPATH=@GIT_TEST_POPATH@ 20 19 GIT_TEST_TEMPLATE_DIR=@GIT_TEST_TEMPLATE_DIR@ 21 20 GIT_TEST_TEXTDOMAINDIR=@GIT_TEST_TEXTDOMAINDIR@ 22 21 GIT_TEST_UTF8_LOCALE=@GIT_TEST_UTF8_LOCALE@
+1 -2
Makefile
··· 3192 3192 -e "s|@GIT_PERF_MAKE_OPTS@|\'$(GIT_PERF_MAKE_OPTS)\'|" \ 3193 3193 -e "s|@GIT_PERF_REPEAT_COUNT@|\'$(GIT_PERF_REPEAT_COUNT)\'|" \ 3194 3194 -e "s|@GIT_PERF_REPO@|\'$(GIT_PERF_REPO)\'|" \ 3195 + -e "s|@GIT_SOURCE_DIR@|\'$(shell pwd)\'|" \ 3195 3196 -e "s|@GIT_TEST_CMP@|\'$(GIT_TEST_CMP)\'|" \ 3196 3197 -e "s|@GIT_TEST_CMP_USE_COPIED_CONTEXT@|\'$(GIT_TEST_CMP_USE_COPIED_CONTEXT)\'|" \ 3197 3198 -e "s|@GIT_TEST_GITPERLLIB@|\'$(shell pwd)/perl/build/lib\'|" \ 3198 3199 -e "s|@GIT_TEST_INDEX_VERSION@|\'$(GIT_TEST_INDEX_VERSION)\'|" \ 3199 - -e "s|@GIT_TEST_MERGE_TOOLS_DIR@|\'$(shell pwd)/mergetools\'|" \ 3200 3200 -e "s|@GIT_TEST_OPTS@|\'$(GIT_TEST_OPTS)\'|" \ 3201 3201 -e "s|@GIT_TEST_PERL_FATAL_WARNINGS@|\'$(GIT_TEST_PERL_FATAL_WARNINGS)\'|" \ 3202 - -e "s|@GIT_TEST_POPATH@|\'$(shell pwd)/po\'|" \ 3203 3202 -e "s|@GIT_TEST_TEMPLATE_DIR@|\'$(shell pwd)/templates/blt\'|" \ 3204 3203 -e "s|@GIT_TEST_TEXTDOMAINDIR@|\'$(shell pwd)/po/build/locale\'|" \ 3205 3204 -e "s|@GIT_TEST_UTF8_LOCALE@|\'$(GIT_TEST_UTF8_LOCALE)\'|" \
+1 -2
contrib/buildsystems/CMakeLists.txt
··· 1169 1169 string(REPLACE "@GIT_PERF_MAKE_OPTS@" "" git_build_options "${git_build_options}") 1170 1170 string(REPLACE "@GIT_PERF_REPEAT_COUNT@" "" git_build_options "${git_build_options}") 1171 1171 string(REPLACE "@GIT_PERF_REPO@" "" git_build_options "${git_build_options}") 1172 + string(REPLACE "@GIT_SOURCE_DIR@" "${CMAKE_SOURCE_DIR}" git_build_options "${git_build_options}") 1172 1173 string(REPLACE "@GIT_TEST_CMP@" "" git_build_options "${git_build_options}") 1173 1174 string(REPLACE "@GIT_TEST_CMP_USE_COPIED_CONTEXT@" "" git_build_options "${git_build_options}") 1174 1175 string(REPLACE "@GIT_TEST_GITPERLLIB@" "'${CMAKE_BINARY_DIR}/perl/build/lib'" git_build_options "${git_build_options}") 1175 1176 string(REPLACE "@GIT_TEST_INDEX_VERSION@" "" git_build_options "${git_build_options}") 1176 - string(REPLACE "@GIT_TEST_MERGE_TOOLS_DIR@" "'${CMAKE_BINARY_DIR}/mergetools'" git_build_options "${git_build_options}") 1177 1177 string(REPLACE "@GIT_TEST_OPTS@" "" git_build_options "${git_build_options}") 1178 1178 string(REPLACE "@GIT_TEST_PERL_FATAL_WARNINGS@" "" git_build_options "${git_build_options}") 1179 - string(REPLACE "@GIT_TEST_POPATH@" "'${CMAKE_BINARY_DIR}/po'" git_build_options "${git_build_options}") 1180 1179 string(REPLACE "@GIT_TEST_TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" git_build_options "${git_build_options}") 1181 1180 string(REPLACE "@GIT_TEST_TEXTDOMAINDIR@" "'${CMAKE_BINARY_DIR}/po/build/locale'" git_build_options "${git_build_options}") 1182 1181 string(REPLACE "@GIT_TEST_UTF8_LOCALE@" "" git_build_options "${git_build_options}")
+1 -2
meson.build
··· 1960 1960 1961 1961 foreach key, value : { 1962 1962 'DIFF': diff.full_path(), 1963 + 'GIT_SOURCE_DIR': meson.project_source_root(), 1963 1964 'GIT_TEST_CMP': diff.full_path() + ' -u', 1964 1965 'GIT_TEST_GITPERLLIB': meson.project_build_root() / 'perl', 1965 - 'GIT_TEST_MERGE_TOOLS_DIR': meson.project_source_root() / 'mergetools', 1966 - 'GIT_TEST_POPATH': meson.project_source_root() / 'po', 1967 1966 'GIT_TEST_TEMPLATE_DIR': meson.project_build_root() / 'templates', 1968 1967 'GIT_TEST_TEXTDOMAINDIR': meson.project_build_root() / 'po', 1969 1968 'PAGER_ENV': get_option('pager_environment'),
+1 -1
t/lib-gettext.sh
··· 7 7 . ./test-lib.sh 8 8 9 9 GIT_TEXTDOMAINDIR="$GIT_TEST_TEXTDOMAINDIR" 10 - GIT_PO_PATH="$GIT_TEST_POPATH" 10 + GIT_PO_PATH="$GIT_SOURCE_DIR/po" 11 11 export GIT_TEXTDOMAINDIR GIT_PO_PATH 12 12 13 13 if test -n "$GIT_TEST_INSTALLED"
+1 -1
t/t7609-mergetool--lib.sh
··· 7 7 . ./test-lib.sh 8 8 9 9 test_expect_success 'mergetool --tool=vimdiff creates the expected layout' ' 10 - . "$GIT_TEST_MERGE_TOOLS_DIR"/vimdiff && 10 + . "$GIT_SOURCE_DIR"/mergetools/vimdiff && 11 11 run_unit_tests 12 12 ' 13 13