Bug 436739 - kdesrc-build fails to update packages that don't have a "master" branch
Summary: kdesrc-build fails to update packages that don't have a "master" branch
Status: RESOLVED FIXED
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-07 16:18 UTC by Alex
Modified: 2022-07-08 00:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2021-05-07 16:18:20 UTC
One example: https://invent.kde.org/network/tok

This project uses "dev" as its default branch. So, if you try to kdesrc-build it, there is this output:

Error updating tok, removing from list of packages to build.
 > tok build was requested, but it has no source code at the requested git branch
Comment 1 Michael Pyne 2022-07-08 00:56:37 UTC
Git commit f1d429d147f8ec0240e6ac0f6ab2eec797a6c4dd by Michael Pyne.
Committed on 08/07/2022 at 00:52.
Pushed by mpyne into branch 'master'.

git: Don't fail to clone due to branch name if none required.

There is a wider variety of potential default branch names from a git
repository that we might want to clone.  Many use now 'main' but not all
of them. We also have modules that use something else entirely, like
'dev' (as reported in bug 436739).

Most of the time the user doesn't actually care about the branch, they
just want whatever the mainline trunk is. To handle this we had
previously defaulted to assuming the branch was 'master' so we could
optimize the amount of data transferred during initial clone.

Now this is likely to lead to an error. Instead, if the user hasn't
specified otherwise, just perform the git clone as normal.

To do this right there's a wee bit of other work elsewhere to detect
which branch head we actually got from the remote git repository but
that's not difficult to do either.

M  +21   -6    modules/ksb/Updater/Git.pm

https://invent.kde.org/sdk/kdesrc-build/commit/f1d429d147f8ec0240e6ac0f6ab2eec797a6c4dd