From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, thuth@redhat.com, berrange@redhat.com
Subject: [PATCH 1/5] configure: remove --with-git= option
Date: Sat, 27 May 2023 11:28:47 +0200 [thread overview]
Message-ID: <20230527092851.705884-2-pbonzini@redhat.com> (raw)
In-Reply-To: <20230527092851.705884-1-pbonzini@redhat.com>
There is not really any scenario where one would use any other git
binary than "the first git in the PATH" aka $(command -v git). In
fact for example "meson subprojects download" or scripts/checkpatch.pl
do not obey the GIT environment variable.
Remove the unnecessary knob, but test for the presence of git in
the configure and git-submodule.sh scripts.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 2 +-
configure | 6 ++----
meson.build | 1 -
scripts/git-submodule.sh | 8 +++++++-
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 08fb6a3b058a..eaeab979966c 100644
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,7 @@ Makefile: .git-submodule-status
git-submodule-update:
ifneq ($(GIT_SUBMODULES_ACTION),ignore)
$(call quiet-command, \
- (GIT="$(GIT)" "$(SRC_PATH)/scripts/git-submodule.sh" $(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \
+ ("$(SRC_PATH)/scripts/git-submodule.sh" $(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \
"GIT","$(GIT_SUBMODULES)")
endif
diff --git a/configure b/configure
index d674a9667310..370e038e63d7 100755
--- a/configure
+++ b/configure
@@ -791,7 +791,7 @@ fi
case $git_submodules_action in
update|validate)
- if test ! -e "$source_path/.git"; then
+ if test ! -e "$source_path/.git" || ! has git; then
echo "ERROR: cannot $git_submodules_action git submodules without .git"
exit 1
fi
@@ -892,7 +892,6 @@ Advanced options (experts only):
--python=PYTHON use specified python [$python]
--ninja=NINJA use specified ninja [$ninja]
--smbd=SMBD use specified smbd [$smbd]
- --with-git=GIT use specified git [$git]
--with-git-submodules=update update git submodules (default if .git dir exists)
--with-git-submodules=validate fail if git submodules are not up to date
--with-git-submodules=ignore do not update or check git submodules (default if no .git dir)
@@ -1699,7 +1698,7 @@ fi
#######################################
# generate config-host.mak
-if ! (GIT="$git" "$source_path/scripts/git-submodule.sh" "$git_submodules_action" "$git_submodules"); then
+if ! ("$source_path/scripts/git-submodule.sh" "$git_submodules_action" "$git_submodules"); then
exit 1
fi
@@ -1709,7 +1708,6 @@ echo "# Automatically generated by configure - do not modify" > $config_host_mak
echo >> $config_host_mak
echo all: >> $config_host_mak
-echo "GIT=$git" >> $config_host_mak
echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak
diff --git a/meson.build b/meson.build
index 2d48aa1e2ef3..b11773ab39e8 100644
--- a/meson.build
+++ b/meson.build
@@ -4027,7 +4027,6 @@ summary(summary_info, bool_yn: true, section: 'Directories')
# Host binaries
summary_info = {}
-summary_info += {'git': config_host['GIT']}
summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
summary_info += {'sphinx-build': sphinx_build}
if config_host.has_key('HAVE_GDB_BIN')
diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
index 7be41f594832..33e995bef1ff 100755
--- a/scripts/git-submodule.sh
+++ b/scripts/git-submodule.sh
@@ -12,7 +12,7 @@ maybe_modules="$@"
# if --with-git-submodules=ignore, do nothing
test "$command" = "ignore" && exit 0
-test -z "$GIT" && GIT=git
+GIT=$(command -v git)
cd "$(dirname "$0")/.."
@@ -57,6 +57,12 @@ then
exit 1
fi
+if test -n "$maybe_modules" && test -z "$GIT"
+then
+ echo "$0: unexpectedly called with submodules but git binary not found"
+ exit 1
+fi
+
modules=""
for m in $maybe_modules
do
--
2.40.1
next prev parent reply other threads:[~2023-05-27 9:30 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-27 9:28 [PATCH 0/5] meson: replace submodules with wrap files Paolo Bonzini
2023-05-27 9:28 ` Paolo Bonzini [this message]
2023-05-30 11:58 ` [PATCH 1/5] configure: remove --with-git= option Thomas Huth
2023-05-30 12:03 ` Paolo Bonzini
2023-05-30 12:17 ` Daniel P. Berrangé
2023-05-30 12:18 ` Daniel P. Berrangé
2023-05-27 9:28 ` [PATCH 2/5] configure: rename --enable-pypi to --enable-download, control subprojects too Paolo Bonzini
2023-05-27 16:49 ` BALATON Zoltan
2023-05-27 19:18 ` Paolo Bonzini
2023-05-30 12:00 ` Thomas Huth
2023-05-27 9:28 ` [PATCH 3/5] meson: subprojects: replace submodules with wrap files Paolo Bonzini
2023-05-30 12:23 ` Daniel P. Berrangé
2023-05-30 12:51 ` Paolo Bonzini
2023-05-30 12:54 ` Daniel P. Berrangé
2023-05-27 9:28 ` [PATCH 4/5] configure: check for SLOF submodule before building pc-bios/s390-ccw Paolo Bonzini
2023-05-30 12:04 ` Thomas Huth
2023-05-30 12:53 ` Paolo Bonzini
2023-05-30 13:00 ` Thomas Huth
2023-05-27 9:28 ` [PATCH 5/5] meson: subprojects: replace berkeley-{soft, test}float-3 with wraps Paolo Bonzini
2023-05-30 12:18 ` [PATCH 0/5] meson: replace submodules with wrap files Thomas Huth
2023-05-30 12:57 ` Daniel P. Berrangé
2023-05-30 13:22 ` Paolo Bonzini
2023-05-30 12:30 ` Daniel P. Berrangé
2023-05-30 12:47 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230527092851.705884-2-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).