-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkglistgen: Support working on git branches #3089
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3089 +/- ##
==========================================
- Coverage 28.02% 28.01% -0.02%
==========================================
Files 86 86
Lines 14981 14987 +6
==========================================
Hits 4199 4199
- Misses 10782 10788 +6 ☔ View full report in Codecov by Sentry. |
pkglistgen/tool.py
Outdated
git_url = split[0] | ||
args = ['git', 'clone', '--recurse-submodules', git_url, cache_dir] | ||
if len(split) == 2: | ||
args.append('--branch') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--single-branch
as well (unconditionally)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can do so ... added another commit for that as it is independend of the branch selection.
Should it also handle if the URL (any part) changes while the cache dir already exists? |
yes, but that can get complex as also the default branch can change server side... maybe we should do that with a second pull request, to avoid blocking Marco's request. |
That only impacts the initial clone though, so I don't see how that would be complex? If it's ok to discard the cache dir on mismatches, then |
Without support for cache invalidation it would currently keep pulling and pushing the wrong URL |
954969b
to
e378573
Compare
I added a 90% switch solution here, but it does not cover the situation when no branch is specified, but default branch switches server side. I reverted the --single-branch clone option therefore to be able to switch later on. |
pkglistgen/tool.py
Outdated
if fragment: | ||
# FIXME: this is not takeing account default branches, which may change server side | ||
logging.debug(subprocess.check_output( | ||
['git', 'switch', fragment], cwd=cache_dir, encoding='utf-8')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git switch
is experimental and might not be available on ibs-slsa-botmaster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be fragment[0]
anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the git on botmaster knows git switch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also git on ibs-slsa-botmaster knows it
e378573
to
2e79964
Compare
@adrianschroeter @Vogtinator we need this for SLFO stagings. Is there any action to be taken or can this be merged? |
it is fine from my side. Please speak up if something needs to be changed. |
Following scmsync syntax where a branch can be specified behind the URL fragment hash Co-authored-by: Fabian Vogt <fabian@ritter-vogt.de>
2e79964
to
feb1e3f
Compare
Following scmsync syntax where a branch can be specified behind the URL fragment hash