From 6f4c40040672eeba80e603ae08dca7201d657138 Mon Sep 17 00:00:00 2001 From: Ahmad Hasan Mubashshir Date: Thu, 6 Nov 2025 15:46:44 +0600 Subject: [PATCH] init-repository: Add HTTPS support for Gerrit remotes Introduce a new --codereview-https option to use HTTPS instead of SSH for Gerrit URLs. Update QtIROptionsHelpers.cmake and document in QtIRHelp.txt. Change-Id: Iae032bdf07e323a8f63946475c692cab23deffc4 Reviewed-by: Alexandru Croitor --- cmake/QtIRGitHelpers.cmake | 11 ++++++++++- cmake/QtIRHelp.txt | 3 +++ cmake/QtIROptionsHelpers.cmake | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmake/QtIRGitHelpers.cmake b/cmake/QtIRGitHelpers.cmake index d851b65a..e3e90588 100644 --- a/cmake/QtIRGitHelpers.cmake +++ b/cmake/QtIRGitHelpers.cmake @@ -102,18 +102,27 @@ endfunction() # - ../qt/qttools-litehtml.git function(qt_ir_add_git_remotes repo_relative_url working_directory) set(gerrit_ssh_base "ssh://@USER@codereview.qt-project.org@PORT@/") - set(gerrit_repo_url "${gerrit_ssh_base}") + set(gerrit_https_base "https://@USER@codereview.qt-project.org@AUTH@/") qt_ir_get_option_value(codereview-username username) + qt_ir_get_option_value(codereview-https https) + + if(https) + set(gerrit_repo_url "${gerrit_https_base}") + else() + set(gerrit_repo_url "${gerrit_ssh_base}") + endif() # If given a username, make a "verbose" remote. # Otherwise, rely on proper SSH configuration. if(username) string(REPLACE "@USER@" "${username}@" gerrit_repo_url "${gerrit_repo_url}") string(REPLACE "@PORT@" ":29418" gerrit_repo_url "${gerrit_repo_url}") + string(REPLACE "@AUTH@" "/a" gerrit_repo_url "${gerrit_repo_url}") else() string(REPLACE "@USER@" "" gerrit_repo_url "${gerrit_repo_url}") string(REPLACE "@PORT@" "" gerrit_repo_url "${gerrit_repo_url}") + string(REPLACE "@AUTH@" "" gerrit_repo_url "${gerrit_repo_url}") endif() set(namespace "qt") diff --git a/cmake/QtIRHelp.txt b/cmake/QtIRHelp.txt index 9d6f5749..d366c9d6 100644 --- a/cmake/QtIRHelp.txt +++ b/cmake/QtIRHelp.txt @@ -98,6 +98,9 @@ Options: username and port number, and thus relies on a correct SSH configuration. + --codereview-https + Specify this option to use HTTPs instead of SSH. + --alternates Adds alternates for each submodule to another full qt5 checkout. This makes this qt5 checkout very small, as it will use the object diff --git a/cmake/QtIROptionsHelpers.cmake b/cmake/QtIROptionsHelpers.cmake index 496ec42b..aa88b026 100644 --- a/cmake/QtIROptionsHelpers.cmake +++ b/cmake/QtIROptionsHelpers.cmake @@ -14,6 +14,7 @@ macro(qt_ir_set_known_command_line_options) qt_ir_commandline_option(berlin TYPE boolean) qt_ir_commandline_option(branch TYPE boolean) qt_ir_commandline_option(codereview-username TYPE string) + qt_ir_commandline_option(codereview-https TYPE boolean) qt_ir_commandline_option(copy-objects TYPE boolean) qt_ir_commandline_option(fetch TYPE boolean DEFAULT_VALUE yes) qt_ir_commandline_option(force SHORT_NAME f TYPE boolean)