[S] Change in osmo-ci[master]: obs: add --git-skip-checkout argument
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/31934 ) Change subject: obs: add --git-skip-checkout argument ...................................................................... obs: add --git-skip-checkout argument Prepare to use this for wireshark, to build a branch on-the-fly that does not get pushed to origin, with Osmocom patches on top of upstream master. Related: OS#2537 Change-Id: Ifc963daf51ba3542f67420daaf7b29745404a92e --- M scripts/obs/lib/__init__.py M scripts/obs/lib/git.py 2 files changed, 22 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/scripts/obs/lib/__init__.py b/scripts/obs/lib/__init__.py index edf19f4..675bcec 100644 --- a/scripts/obs/lib/__init__.py +++ b/scripts/obs/lib/__init__.py @@ -36,6 +36,9 @@ parser.add_argument("-s", "--git-skip-fetch", help="do not fetch already cloned git repositories", action="store_false", dest="git_fetch") + parser.add_argument("-S", "--git-skip-checkout", + help="do not checkout and reset to a branch/tag", + action="store_false", dest="git_checkout") parser.add_argument("-m", "--meta", action="store_true", help="build a meta package (e.g. osmocom-nightly)") parser.add_argument("-i", "--ignore-req", action="store_true", diff --git a/scripts/obs/lib/git.py b/scripts/obs/lib/git.py index f1ee98d..15cb276 100644 --- a/scripts/obs/lib/git.py +++ b/scripts/obs/lib/git.py @@ -53,6 +53,11 @@ def checkout(project, branch): repo_path = get_repo_path(project) + if not lib.args.git_checkout: + ref = lib.run_cmd(["git", "log", "--pretty=oneline", "--abbrev-commit", + "-1"], cwd=repo_path).output.rstrip() + print(f"{project}: skipping git checkout, current commit: {ref}") + return print(f"{project}: 'git checkout -f {branch}'") lib.run_cmd(["git", "checkout", "-f", branch], cwd=repo_path) print(f"{project}: 'git reset --hard {branch}'") -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/31934 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Ifc963daf51ba3542f67420daaf7b29745404a92e Gerrit-Change-Number: 31934 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged
participants (1)
-
osmith