From: Daniel Gomez <da.gomez@kernel.org>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: kdevops@lists.linux.dev, Daniel Gomez <da.gomez@kernel.org>,
Daniel Gomez <da.gomez@samsung.com>
Subject: [PATCH 1/2] generate_refs: fix gitref duplicated refs
Date: Thu, 15 May 2025 10:06:19 +0200 [thread overview]
Message-ID: <20250515-gitref-fixes-v1-1-cbd37288d5b9@samsung.com> (raw)
In-Reply-To: <20250515-gitref-fixes-v1-0-cbd37288d5b9@samsung.com>
From: Daniel Gomez <da.gomez@samsung.com>
Static references in YAML where not in consideration when using gitref
for the final ref generated file. Read them first and exclude any git
reference found that is already in the static list.
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
scripts/generate_refs.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/scripts/generate_refs.py b/scripts/generate_refs.py
index cea4f7251226947f2983c31a4d26cc9d65eb7fac..e7032000bbac24ac872b83c7d962c8ee097064b2 100755
--- a/scripts/generate_refs.py
+++ b/scripts/generate_refs.py
@@ -257,7 +257,7 @@ def remote(args) -> List:
return [heads["stdout"], tags["stdout"]]
-def gitref_getreflist(args, reflist):
+def gitref_getreflist(args, reflist, extraconfs):
refs = []
for refline in reflist.splitlines():
if "^{}" in refline:
@@ -265,6 +265,8 @@ def gitref_getreflist(args, reflist):
if len(refs) >= args.refs:
break
ref_name = refline.split("/")[-1]
+ if any(config["ref"] == ref_name for config in extraconfs):
+ continue
refs.append(ref_name)
logging.debug("release: {}".format(ref_name))
return refs
@@ -296,14 +298,15 @@ def gitref(args) -> None:
# Only generate git reference if we have connection. Otherwise the output
# file would contain static reference only and they should be already
# part of the kreleases generation.
+ extraconfs = _get_extraconfs(args)
if _check_connection("git.kernel.org", 80):
reflist = []
refstr = remote(args)
for rl in refstr:
- _refs = gitref_getreflist(args, rl)
+ _refs = gitref_getreflist(args, rl, extraconfs)
for r in _refs:
reflist.append(r)
- ref_generator(args, reflist, _get_extraconfs(args))
+ ref_generator(args, reflist, extraconfs)
def kreleases(args) -> None:
--
2.49.0
next prev parent reply other threads:[~2025-05-15 8:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 8:06 [PATCH 0/2] Git reference handling improvements Daniel Gomez
2025-05-15 8:06 ` Daniel Gomez [this message]
2025-05-15 8:06 ` [PATCH 2/2] generate_refs: prioritize static refs in gitref generation Daniel Gomez
2025-05-15 17:26 ` [PATCH 0/2] Git reference handling improvements Luis Chamberlain
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=20250515-gitref-fixes-v1-1-cbd37288d5b9@samsung.com \
--to=da.gomez@kernel.org \
--cc=da.gomez@samsung.com \
--cc=kdevops@lists.linux.dev \
--cc=mcgrof@kernel.org \
/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