From 0d268197a40282eb7962094e1732a933af00a744 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 30 May 2023 17:37:02 +0200 Subject: [PATCH] plugins: for_all_repos: Add support for commit/branch Add corresponding environment variables for the new keys and declare the existing KAS_REPO_REFSPEC as deprecated in lock-step with the key it mirrors. Signed-off-by: Jan Kiszka --- kas/plugins/for_all_repos.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kas/plugins/for_all_repos.py b/kas/plugins/for_all_repos.py index 2581ae7..b720eb2 100644 --- a/kas/plugins/for_all_repos.py +++ b/kas/plugins/for_all_repos.py @@ -48,9 +48,19 @@ * ``KAS_REPO_URL``: The URL from which this repository was cloned, or an empty string if no remote URL was given in the config file. + * ``KAS_REPO_COMMIT``: The commit ID which was checked out for this + repository, or an empty string if no commit was given in the config + file. + + * ``KAS_REPO_BRANCH``: The branch which was checked out for this + repository, or an empty string if no branch was given in the config + file. + * ``KAS_REPO_REFSPEC``: The refspec which was checked out for this repository, or an empty string if no refspec was given in the config - file. + file. This variable is obsolete and will be removed when support for + respec keys is removed as well. Migrate your repos to commit/branch + and use the related variables instead. """ import logging @@ -107,6 +117,8 @@ class ForAllReposCommand(Command): 'KAS_REPO_NAME': repo.name, 'KAS_REPO_PATH': repo.path, 'KAS_REPO_URL': '' if repo.operations_disabled else repo.url, + 'KAS_REPO_COMMIT': repo.commit or '', + 'KAS_REPO_BRANCH': repo.branch or '', 'KAS_REPO_REFSPEC': repo.refspec or '', } logging.info('%s$ %s', repo.path, self.command)