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
On Sat, May 27, 2023 at 11:28:47AM +0200, Paolo Bonzini wrote: > 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(-) If you just update the commit message to say we are intentionally reverting functionality from cc84d63a42e31c2afa884fc78610a65ab8ecc06a and people should create a wrapper script instead: Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
On 27/05/2023 11.28, Paolo Bonzini wrote:
> 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(-)
The commit cc84d63a42e31c2a that introduce this switch gave a
rationale:
Some users can't run a bare 'git' command, due to need for a transparent
proxying solution such as 'tsocks'. This adds an argument to configure to
let users specify such a thing:
./configure --with-git="tsocks git"
But if the plain "git" command is unusable on their system,
they should likely introduce a proper wrapper on their end
for this command anyway, so IMHO it's ok if we remove this
again. Daniel, what do you think?
Thomas
On Tue, May 30, 2023 at 1:58 PM Thomas Huth <thuth@redhat.com> wrote: > The commit cc84d63a42e31c2a that introduce this switch gave a > rationale: > > Some users can't run a bare 'git' command, due to need for a transparent > proxying solution such as 'tsocks'. This adds an argument to configure to > let users specify such a thing: > > ./configure --with-git="tsocks git" I see, thanks for the additional information--it makes sense to include it in the commit message. My impression is that the "smart HTTP" protocol has made this concern less important. Smart HTTP was introduced in 2009, but back in 2017 the git protocol running on port 9418 was still quite common. QEMU itself switched from git to https in 2018 with commit a897f22b596b62, about a year after --with-git was introduced. Paolo > But if the plain "git" command is unusable on their system, > they should likely introduce a proper wrapper on their end > for this command anyway, so IMHO it's ok if we remove this > again. Daniel, what do you think?
On Tue, May 30, 2023 at 02:03:11PM +0200, Paolo Bonzini wrote: > On Tue, May 30, 2023 at 1:58 PM Thomas Huth <thuth@redhat.com> wrote: > > The commit cc84d63a42e31c2a that introduce this switch gave a > > rationale: > > > > Some users can't run a bare 'git' command, due to need for a transparent > > proxying solution such as 'tsocks'. This adds an argument to configure to > > let users specify such a thing: > > > > ./configure --with-git="tsocks git" > > I see, thanks for the additional information--it makes sense to > include it in the commit message. > > My impression is that the "smart HTTP" protocol has made this concern > less important. Smart HTTP was introduced in 2009, but back in 2017 > the git protocol running on port 9418 was still quite common. QEMU > itself switched from git to https in 2018 with commit a897f22b596b62, > about a year after --with-git was introduced. Here is the original thread: https://lists.nongnu.org/archive/html/qemu-devel/2017-10/msg05005.html yes it was about 'git://' protocol, and yes, creating a wrapper script call 'git' was a viable option too. I just added --with-git as a convenience. > > But if the plain "git" command is unusable on their system, > > they should likely introduce a proper wrapper on their end > > for this command anyway, so IMHO it's ok if we remove this > > again. Daniel, what do you think? > With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
© 2016 - 2026 Red Hat, Inc.